diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 1affdd56786..f793096e509 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 f010cccf1a6..c89479252e7 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]