diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-23 15:12:27 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-28 17:15:30 +0200 |
commit | a4f11fa99d44ac6d5619c502491d49ec8dff896f (patch) | |
tree | 2607c10f25ab3cdd306115f9090a86d0f8b79d54 /cmake/QtPostProcess.cmake | |
parent | 040a7cfa93f12e8091954e463cdce3b515917c40 (diff) |
CMake: Create Qt6HostInfo package
This package is supposed to be loaded when cross-building Qt from the
host Qt installation prefix. It provides information about the host Qt
by setting various variables. The information reflects what "qmake
-query" of the host Qt would return.
All provided variable names begin with "QT6_HOST_INFO_".
Change-Id: Id568923a318d6e3b48c450663519a3727f615a8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPostProcess.cmake')
-rw-r--r-- | cmake/QtPostProcess.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 0949415281..c6b0dc42e2 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -335,8 +335,24 @@ function(qt_wrap_string_in_if_ninja_multi_config content out_var) ${content}endif()\n" PARENT_SCOPE) endfunction() +function(qt_create_hostinfo_package) + set(package "${INSTALL_CMAKE_NAMESPACE}HostInfo") + qt_path_join(config_file_path "${QT_CONFIG_BUILD_DIR}/${package}/${package}Config.cmake") + qt_path_join(install_destination ${QT_CONFIG_INSTALL_DIR} ${package}) + set(var_prefix "QT${PROJECT_VERSION_MAJOR}_HOST_INFO_") + configure_package_config_file( + "${CMAKE_CURRENT_LIST_DIR}/QtHostInfoConfig.cmake.in" + "${config_file_path}" + INSTALL_DESTINATION "${install_destination}" + NO_SET_AND_CHECK_MACRO + NO_CHECK_REQUIRED_COMPONENTS_MACRO) + qt_install(FILES "${config_file_path}" DESTINATION "${install_destination}") +endfunction() + function(qt_generate_build_internals_extra_cmake_code) if(PROJECT_NAME STREQUAL "QtBase") + qt_create_hostinfo_package() + foreach(var IN LISTS QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT) string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "set(${var} \"${${var}}\" CACHE INTERNAL \"\")\n") endforeach() |