diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-07 16:04:17 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-09 11:14:58 +0000 |
commit | f8b4c1e51049b93720a80a957bec08653ac7a291 (patch) | |
tree | 922af1f762c7dd9cc7dfe6969c10af6b730dfa06 /cmake/QtTargetHelpers.cmake | |
parent | 6c27e9914fbb9940f347f85646e00ba2aa7174c3 (diff) |
CMake: Place internal apps in the correct output directory
In a -debug-and-release build, apps were placed under bin/Release
rather than just bin.
Apply the logic we use for tools for apps as well. Rename and move
the common functions into QtTargetHelpers.cmake.
Fixes: QTBUG-95028
Change-Id: I5a9082ea50c9238c8fcf0c6dd099708fbc571bf8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7b3d9efc042bec4ce23a6e75553cced3d14d1542)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake/QtTargetHelpers.cmake')
-rw-r--r-- | cmake/QtTargetHelpers.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index a4114a6eb3..266bcac490 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -736,3 +736,27 @@ function(qt_internal_qtfy_target out_var target) set(${out_var} "Qt${target}" PARENT_SCOPE) set(${out_var}_versioned "Qt${PROJECT_VERSION_MAJOR}${target}" PARENT_SCOPE) endfunction() + +function(qt_internal_get_main_cmake_configuration out_var) + if(CMAKE_BUILD_TYPE) + set(config "${CMAKE_BUILD_TYPE}") + elseif(QT_MULTI_CONFIG_FIRST_CONFIG) + set(config "${QT_MULTI_CONFIG_FIRST_CONFIG}") + endif() + set("${out_var}" "${config}" PARENT_SCOPE) +endfunction() + +function(qt_internal_get_upper_case_main_cmake_configuration out_var) + qt_internal_get_main_cmake_configuration("${out_var}") + string(TOUPPER "${${out_var}}" upper_config) + set("${out_var}" "${upper_config}" PARENT_SCOPE) +endfunction() + +function(qt_internal_adjust_main_config_runtime_output_dir target output_dir) + # When building Qt with multiple configurations, place the main configuration executable + # directly in ${output_dir}, rather than a ${output_dir}/<CONFIG> subdirectory. + qt_internal_get_upper_case_main_cmake_configuration(main_cmake_configuration) + set_target_properties("${target}" PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${main_cmake_configuration} "${output_dir}" + ) +endfunction() |