summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2021-03-29 16:27:33 +0200
committerKai Köhne <kai.koehne@qt.io>2021-05-07 21:06:58 +0200
commitd5c3e1336bce42df53d4b525237244486ba5422d (patch)
tree778c5a60d826ae470b20480b9996c80a4a4691b2
parent5c29f981fa069907678f961cf58ecefd64bf268b (diff)
Allow to load -developer-build without configurations into an IDE
Let -developer-build, -cmake-file-api set up the CMake File API query, so that the build can be loaded directly into IDE's like Qt Creator. [ChangeLog][Build System] configure -developer-build now sets up the CMake File API query, so that a build can be loaded without reconfiguration into Qt Creator and other IDE's. Pass -developer-build -no-cmake-file-api to configure to disable this. Fixes: QTBUG-89487 Change-Id: I69199b8f96da02e42e5610aa6f49881c1582f7da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--cmake/QtProcessConfigureArgs.cmake12
-rw-r--r--config_help.txt2
2 files changed, 14 insertions, 0 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 1affdd5678..f793096e50 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -91,6 +91,12 @@ while(NOT "${configure_args}" STREQUAL "")
string(APPEND path "/mkspecs")
endif()
push("-DINSTALL_MKSPECSDIR=${path}")
+ elseif(arg STREQUAL "-developer-build")
+ set(developer_build TRUE)
+ elseif(arg STREQUAL "-cmake-file-api")
+ set(cmake_file_api TRUE)
+ elseif(arg STREQUAL "-no-cmake-file-api")
+ set(cmake_file_api FALSE)
elseif(arg MATCHES "^-host.*dir")
message(FATAL_ERROR "${arg} is not supported anymore.")
elseif(arg STREQUAL "--")
@@ -863,6 +869,12 @@ translate_list_input(includes QT_EXTRA_INCLUDEPATHS)
translate_list_input(lpaths QT_EXTRA_LIBDIRS)
translate_list_input(rpaths QT_EXTRA_RPATHS)
+if(cmake_file_api OR (developer_build AND NOT DEFINED cmake_file_api))
+ foreach(file cache-v2 cmakeFiles-v1 codemodel-v2 toolchains-v1)
+ file(WRITE "${CMAKE_BINARY_DIR}/.cmake/api/v1/query/${file}" "")
+ endforeach()
+endif()
+
foreach(input ${config_inputs})
qt_feature_normalize_name("${input}" cmake_input)
push("-DINPUT_${cmake_input}=${INPUT_${input}}")
diff --git a/config_help.txt b/config_help.txt
index f010cccf1a..c89479252e 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -57,6 +57,8 @@ Build options:
CMake instead of auto-detecting one.
-cmake-use-default-generator ... Turn off auto-detection of the CMake build
system generator.
+ -cmake-file-api ...... Let CMake store build metadata for loading the build
+ into an IDE. [no; yes if -developer-build]
-no-guess-compiler ... Do not guess the compiler from the target mkspec.
-release ............. Build Qt with debugging turned off [yes]
-debug ............... Build Qt with debugging turned on [no]