From a4f11fa99d44ac6d5619c502491d49ec8dff896f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 23 Jun 2020 15:12:27 +0200 Subject: 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 --- cmake/QtPostProcess.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cmake/QtPostProcess.cmake') 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() -- cgit v1.2.3