summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-09-17 12:16:47 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-09-22 22:20:43 +0200
commit25cc901f049cdabcffda02b640a9a684fca8caa4 (patch)
tree873b30b07e50e3b155f5468eac7e6c0d71eeb343 /cmake
parent8d4eb292b2e8fc14437db97febdc2eebe36ed3ce (diff)
CMake: Fix configure -redo for top-level builds
When re-doing in a top-level build, we did not read the config.opt file from the top-level directory. Also, the config.opt file should not contain the -top-level argument. This is an internal option, and on Windows, it was already missing. The information whether we're doing a top-level build is now passed in the CMake variable TOP_LEVEL. Change-Id: Iaecd7306a4b6d9ad494684c201cf12f8e74d684b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake17
1 files changed, 10 insertions, 7 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 44ac0cc341..25910cf24c 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -6,6 +6,7 @@
# with one option per line.
# MODULE_ROOT: The source directory of the module to be built.
# If empty, qtbase/top-level is assumed.
+# TOP_LEVEL: TRUE, if this is a top-level build.
include(${CMAKE_CURRENT_LIST_DIR}/QtFeatureCommon.cmake)
@@ -31,7 +32,15 @@ else()
endif()
set(configure_filename "configure.cmake")
set(commandline_filename "qt_cmdline.cmake")
-set(commandline_files "${MODULE_ROOT}/${commandline_filename}")
+if(TOP_LEVEL)
+ get_filename_component(MODULE_ROOT "../.." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
+ file(GLOB commandline_files "${MODULE_ROOT}/*/${commandline_filename}")
+ if(EXISTS "${MODULE_ROOT}/${commandline_filename}")
+ list(PREPEND commandline_files "${MODULE_ROOT}/${commandline_filename}")
+ endif()
+else()
+ set(commandline_files "${MODULE_ROOT}/${commandline_filename}")
+endif()
file(STRINGS "${OPTFILE}" configure_args)
list(FILTER configure_args EXCLUDE REGEX "^[ \t]*$")
list(TRANSFORM configure_args STRIP)
@@ -47,12 +56,6 @@ while(configure_args)
list(POP_FRONT configure_args generator)
elseif(arg STREQUAL "-cmake-use-default-generator")
set(auto_detect_generator FALSE)
- elseif(arg STREQUAL "-top-level")
- get_filename_component(MODULE_ROOT "../.." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
- file(GLOB commandline_files "${MODULE_ROOT}/*/${commandline_filename}")
- if(EXISTS "${MODULE_ROOT}/${commandline_filename}")
- list(PREPEND commandline_files "${MODULE_ROOT}/${commandline_filename}")
- endif()
elseif(arg STREQUAL "-skip")
list(POP_FRONT configure_args qtrepo)
push("-DBUILD_${qtrepo}=OFF")