diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-31 10:38:53 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-09-11 00:41:10 +0200 |
commit | 457cf10f7e0d91dd23dd499f6b70f0224e35e8be (patch) | |
tree | 2adc117d96b73d2dc103dc669e9a8eda6ad59ea0 /cmake/QtBaseGlobalTargets.cmake | |
parent | c30ea1f4124420f7d9e961f51898cedbe4c5d4ee (diff) |
CMake: Introduce qt-configure-module
Add a convenience script to configure a Qt module separately.
This script reads and interprets the qt_cmdline.cmake files of the
Qt module to be configured and eventually calls qt-cmake-private.
Example usage:
<install-prefix>/bin/qt-configure-module <source-root>/qtdeclarative
-qml-network -- --trace-expand --trace-redirect=cmake.trace
Change-Id: I026f1a050cd3f4df740611c32ba8c03161bba7a3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake/QtBaseGlobalTargets.cmake')
-rw-r--r-- | cmake/QtBaseGlobalTargets.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 4e4f7a442a..de3c1af434 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -239,6 +239,30 @@ qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private.bat" DES endif() unset(__qt_cmake_extra) +# Provide a script to configure Qt modules. +if(QT_WILL_INSTALL) + set(__relative_path_to_processconfigureargs_script + "${__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir}") +else() + file(RELATIVE_PATH __relative_path_to_processconfigureargs_script + "${__qt_bin_dir_absolute}" "${CMAKE_CURRENT_LIST_DIR}") +endif() +string(APPEND __relative_path_to_processconfigureargs_script "/QtProcessConfigureArgs.cmake") +file(TO_NATIVE_PATH "${__relative_path_to_processconfigureargs_script}" + __relative_path_to_processconfigureargs_script) +if(CMAKE_HOST_UNIX) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.in" + "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module" @ONLY) + qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module" + DESTINATION "${INSTALL_BINDIR}") +else() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.bat.in" + "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat" @ONLY) + qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat" + DESTINATION "${INSTALL_BINDIR}") +endif() +unset(__relative_path_to_processconfigureargs_script) + # Provide a private convenience wrapper to configure and build one or more standalone tests. # Calling CMake directly on a Qt test project won't work because the project does not call # find_package(Qt...) to get all dependencies like examples do. @@ -409,6 +433,7 @@ qt_copy_or_install(FILES cmake/QtPrecompiledHeadersHelpers.cmake cmake/QtPriHelpers.cmake cmake/QtPrlHelpers.cmake + cmake/QtProcessConfigureArgs.cmake cmake/QtQmakeHelpers.cmake cmake/QtResourceHelpers.cmake cmake/QtRpathHelpers.cmake |