Skip to content

Commit

Permalink
Allow to load -developer-build without configurations into an IDE
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
kkoehne committed May 7, 2021
1 parent 5c29f98 commit d5c3e13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake/QtProcessConfigureArgs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "--")
Expand Down Expand Up @@ -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}}")
Expand Down
2 changes: 2 additions & 0 deletions config_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d5c3e13

Please sign in to comment.