summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-05-15 11:38:53 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-19 10:16:11 +0200
commitb3e01d608eb39302914c45af7aa18e3178d1309c (patch)
tree550835fc9d9a449bd9e729d4908cdfd70d6e1fbd /bin
parentf240d94f140ba1614828804efafd2fc5e6d00099 (diff)
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'bin')
-rw-r--r--bin/qt-cmake-private-install.cmake.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/qt-cmake-private-install.cmake.in b/bin/qt-cmake-private-install.cmake.in
new file mode 100644
index 0000000000..bc9895791b
--- /dev/null
+++ b/bin/qt-cmake-private-install.cmake.in
@@ -0,0 +1,19 @@
+# Calls cmake --install ${QT_BUILD_DIR} --config <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()