diff --git a/bin/qt-cmake-private-install.cmake.in b/bin/qt-cmake-private-install.cmake.in new file mode 100644 index 00000000000..bc9895791bd --- /dev/null +++ b/bin/qt-cmake-private-install.cmake.in @@ -0,0 +1,19 @@ +# Calls cmake --install ${QT_BUILD_DIR} --config for each config +# with which Qt was built with. +# This is required to enable installation of all configurations of +# a Qt built with Ninja Multi-Config until the following issue is fixed. +# https://gitlab.kitware.com/cmake/cmake/-/issues/20713 +set(configs "@__qt_configured_configs@") +if(NOT QT_BUILD_DIR) + message(FATAL_ERROR "No QT_BUILD_DIR value provided to qt-cmake-private-install.") +endif() +foreach(config ${configs}) + message(STATUS "Installing configuration: '${config}'") + set(args "${CMAKE_COMMAND}" --install ${QT_BUILD_DIR} --config "${config}") + execute_process(COMMAND ${args} + COMMAND_ECHO STDOUT + RESULT_VARIABLE result) + if(NOT "${result}" STREQUAL "0") + message(FATAL_ERROR "Installing configuration '${config}' failed with exit code: ${result}.") + endif() +endforeach() diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index e5006f0e20a..ea765847ebd 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 diff --git a/coin/instructions/call_host_install.yaml b/coin/instructions/call_host_install.yaml new file mode 100644 index 00000000000..4762763a1e2 --- /dev/null +++ b/coin/instructions/call_host_install.yaml @@ -0,0 +1,9 @@ +type: Group +instructions: + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_SCRIPT_PATH}}/bin/qt-cmake-private-install.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. diff --git a/coin/instructions/call_target_install.yaml b/coin/instructions/call_target_install.yaml new file mode 100644 index 00000000000..0f452401019 --- /dev/null +++ b/coin/instructions/call_target_install.yaml @@ -0,0 +1,9 @@ +type: Group +instructions: + - type: ExecuteCommand + command: "{{.Env.TARGET_ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_SCRIPT_PATH}}/bin/qt-cmake-private-install.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. diff --git a/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml b/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml index 46273d33450..5d8f5e9c15a 100644 --- a/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml +++ b/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml @@ -24,21 +24,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.InstallDir}}/host" + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "" @@ -56,21 +49,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.InstallDir}}/target" + - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "" diff --git a/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml b/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml index 5a14ee0b870..6a51bdc9753 100644 --- a/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml +++ b/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml @@ -27,21 +27,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.BuildDir}}" + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "" @@ -62,21 +55,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.BuildDir}}" + - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "" diff --git a/coin/instructions/cmake_module_build_instructions.yaml b/coin/instructions/cmake_module_build_instructions.yaml index 02c1e7b2e39..b6c72bf23ff 100644 --- a/coin/instructions/cmake_module_build_instructions.yaml +++ b/coin/instructions/cmake_module_build_instructions.yaml @@ -16,21 +16,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.InstallDir}}" + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: SignPackage enable_if: condition: property diff --git a/coin/instructions/cmake_qtbase_build_instructions.yaml b/coin/instructions/cmake_qtbase_build_instructions.yaml index fe85d1681f2..89d95ab4b3e 100644 --- a/coin/instructions/cmake_qtbase_build_instructions.yaml +++ b/coin/instructions/cmake_qtbase_build_instructions.yaml @@ -19,21 +19,14 @@ instructions: maxTimeBetweenOutput: 1200 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableValue: "{{.BuildDir}}" + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install package for archiving. + - !include "{{qt/qtbase}}/call_host_install.yaml" - type: SignPackage enable_if: condition: property