diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtAppHelpers.cmake | 3 | ||||
-rw-r--r-- | cmake/QtPostProcess.cmake | 1 | ||||
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 21 | ||||
-rw-r--r-- | cmake/QtToolHelpers.cmake | 9 |
4 files changed, 33 insertions, 1 deletions
diff --git a/cmake/QtAppHelpers.cmake b/cmake/QtAppHelpers.cmake index ff32be0b89..846a85028f 100644 --- a/cmake/QtAppHelpers.cmake +++ b/cmake/QtAppHelpers.cmake @@ -49,6 +49,9 @@ function(qt_internal_add_app target) # if CONFIG += console was encountered during conversion. set_target_properties("${target}" PROPERTIES WIN32_EXECUTABLE TRUE) + # Consider every app as user facing tool. + set_property(GLOBAL APPEND PROPERTY QT_USER_FACING_TOOL_TARGETS ${target}) + qt_add_list_file_finalizer(qt_internal_finalize_app ${target}) endfunction() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 7ee5e933e0..0cb0edf1c6 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -13,3 +13,4 @@ if (ANDROID) endif() qt_internal_install_prl_files() +qt_internal_generate_user_facing_tools_info() diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 9a36e2ada4..89b112c2b0 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -707,3 +707,24 @@ function(qt_internal_install_prl_files) ) endforeach() endfunction() + +function(qt_internal_generate_user_facing_tools_info) + if("${INSTALL_PUBLICBINDIR}" STREQUAL "") + return() + endif() + get_property(user_facing_tool_targets GLOBAL PROPERTY QT_USER_FACING_TOOL_TARGETS) + set(lines "") + foreach(target ${user_facing_tool_targets}) + get_target_property(filename ${target} OUTPUT_NAME) + if(NOT filename) + set(filename ${target}) + endif() + qt_path_join(tool_target_path "${CMAKE_INSTALL_PREFIX}" "${INSTALL_BINDIR}" "${filename}") + qt_path_join(tool_link_path "${INSTALL_PUBLICBINDIR}" "${filename}${PROJECT_VERSION_MAJOR}") + list(APPEND lines "${tool_target_path} ${tool_link_path}") + endforeach() + string(REPLACE ";" "\n" content "${lines}") + string(APPEND content "\n") + set(out_file "${PROJECT_BINARY_DIR}/user_facing_tool_links.txt") + file(WRITE "${out_file}" "${content}") +endfunction() diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index 869a6e3300..e052479b6c 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -2,6 +2,9 @@ # The BOOTSTRAP option allows building it as standalone program, otherwise # it will be linked against QtCore. # +# USER_FACING can be passed to mark the tool as a program that is supposed to be +# started directly by users. +# # We must pass this function a target name obtained from # qt_get_tool_target_name like this: # qt_get_tool_target_name(target_name my_tool) @@ -22,7 +25,7 @@ function(qt_internal_add_tool target_name) qt_tool_target_to_name(name ${target_name}) set(one_value_keywords TOOLS_TARGET EXTRA_CMAKE_FILES INSTALL_DIR ${__default_target_info_args}) - qt_parse_all_arguments(arg "qt_add_tool" "BOOTSTRAP;NO_INSTALL" + qt_parse_all_arguments(arg "qt_add_tool" "BOOTSTRAP;NO_INSTALL;USER_FACING" "${one_value_keywords}" "${__default_private_args}" ${ARGN}) @@ -175,6 +178,10 @@ function(qt_internal_add_tool target_name) ) endif() + if(arg_USER_FACING) + set_property(GLOBAL APPEND PROPERTY QT_USER_FACING_TOOL_TARGETS ${target_name}) + endif() + # If building with a multi-config configuration, the main configuration tool will be placed in # ./bin, while the rest will be in <CONFIG> specific subdirectories. qt_get_tool_cmake_configuration(tool_cmake_configuration) |