qt5base-lts/bin/qt-cmake-private-install.cmake.in
Alexandru Croitor 09fdddeb32 CMake: Don't strip debug builds with qt-cmake-private-install in CI
This provides better stack traces and easier debugging in CI VMs.

Put the MSVC check for disabling stripping into the same place so
there's one location to decide whether stripping should happen.

Amends 60d804c567

Pick-to: 6.6
Fixes: QTBUG-118070
Change-Id: I4684036c8a5a137d14eea58954b34fe1ceb7f804
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-03 18:24:46 +02:00

30 lines
1.1 KiB
CMake

# 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 issues are fixed:
# https://gitlab.kitware.com/cmake/cmake/-/issues/20713
# https://gitlab.kitware.com/cmake/cmake/-/issues/21475
set(configs "@__qt_configured_configs@")
set(should_skip_strip "@__qt_skip_strip_installed_artifacts@")
if(NOT QT_BUILD_DIR)
message(FATAL_ERROR "No QT_BUILD_DIR value provided to qt-cmake-private-install.")
endif()
if(should_skip_strip)
unset(strip_arg)
else()
set(strip_arg --strip)
endif()
foreach(config ${configs})
message(STATUS "Installing configuration: '${config}'")
set(args "${CMAKE_COMMAND}" --install ${QT_BUILD_DIR} --config "${config}" ${strip_arg})
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()