diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-15 13:57:15 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-15 17:33:51 +0000 |
commit | 9542e78525b422159406d8fa63e30dcd0f926411 (patch) | |
tree | 9b6b90610897ca19389c4ab6a621dbcce812bf56 /cmake/QtBuild.cmake | |
parent | c097256ee4b207284148a8026bb29fc4453efeae (diff) |
Use the qt_build_repo() macros for building qtbase as well
To implement this, create a new Qt5BuildInternals package.
All child Qt modules like qtsvg should use
find_package(Qt5BuildInternals) or
find_package(Qt5 COMPONENTS BuildInternals) in the their
top level CMakeLists.txt.
This will make the qt_build_repo() macros available.
For qtbase we slightly cheat, and specify a CMAKE_PREFIX_PATH
pointing to the source folder that contains the BuildInternals
package.
For the other modules we actually use a configured and installed
package Config file.
This change moves variables that used to be written into the
QtCore Config file into the BuildInternals package. This way
things that are relevant only for building additional Qt modules
does not pollute the QtCore package.
Task-number: QTBUG-75580
Change-Id: I5479adff2f7903c9c2862d28c05c7f485ce3e4eb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index bfbd0f69e4..cc5b9e63e1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -160,6 +160,10 @@ endif() string(APPEND QT_CONFIG_INSTALL_DIR ${__config_path_part}) unset(__config_path_part) +# This is used to hold extra cmake code that should be put into QtBuildInternalsExtra.cmake file +# at the QtPostProcess stage. +set(QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE "") + # Functions and macros: # Wraps install() command. In a prefix build, simply passes along arguments to install(). @@ -926,25 +930,6 @@ function(add_qt_module target) list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() - set(extra_cmake_code "") - - if(target STREQUAL Core) - # Propagate common variables via QtCore package. - string(APPEND extra_cmake_code "set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})") - string(APPEND extra_cmake_code " -option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_LIBS})") - string(APPEND extra_cmake_code " -set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") - string(APPEND extra_cmake_code " -set(_qt_core_cmake_dir \${CMAKE_CURRENT_LIST_DIR})") - - # Propagate developer builds to other modules via QtCore package. - if(FEATURE_developer_build) - string(APPEND extra_cmake_code " -set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") - endif() - endif() - configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" |