From b3e01d608eb39302914c45af7aa18e3178d1309c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 15 May 2020 11:38:53 +0200 Subject: CMake: Use custom install script to support Ninja Multi-Config builds Calling cmake --install . only installs a single configuration. To install both debug and release artifacts, the install invocation needs to be done for each configuration. To keep the Coin instruction code simpler, delegate the looping over configurations to a custom CMake script, and use it in the Coin instructions. Replace all cmake --install calls in the instructions with calls to either call_host_install.yaml or call_target_install.yaml. The path to the script depends on whether we are building qtbase or another module. In the former case the script should be called from the build dir, otherwise from the install dir. The other distinction is whether the host or target env prefix needs to be added. Task-number: QTBUG-80900 Change-Id: Ied4bf739e2b1a2307f22fc79c1cfad746c8cbc44 Reviewed-by: Joerg Bornemann --- cmake/QtBaseGlobalTargets.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmake/QtBaseGlobalTargets.cmake') diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index e5006f0e20..ea765847eb 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -224,6 +224,19 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-standalone-test.in" qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}" DESTINATION "${INSTALL_BINDIR}") +# Create an installation script that the CI can use to handle installation for both +# single and multiple configurations. +set(__qt_cmake_install_script_name "qt-cmake-private-install.cmake") +if(CMAKE_CONFIGURATION_TYPES) + set(__qt_configured_configs "${CMAKE_CONFIGURATION_TYPES}") +elseif(CMAKE_BUILD_TYPE) + set(__qt_configured_configs "${CMAKE_BUILD_TYPE}") +endif() +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in" + "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}" @ONLY) +qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}" + DESTINATION "${INSTALL_BINDIR}") + ## Library to hold global features: ## These features are stored and accessed via Qt::GlobalConfig, but the ## files always lived in Qt::Core, so we keep it that way -- cgit v1.2.3