diff --git a/cmake/QtBuildRepoHelpers.cmake b/cmake/QtBuildRepoHelpers.cmake index a93fce7e4be..192dc7662d1 100644 --- a/cmake/QtBuildRepoHelpers.cmake +++ b/cmake/QtBuildRepoHelpers.cmake @@ -308,6 +308,24 @@ macro(qt_build_repo_begin) if(NOT TARGET host_tools) add_custom_target(host_tools) add_custom_target(bootstrap_tools) + + # TODO: Investigate complexity of installing tools for shared builds. + # Currently installing host tools without libraries only really makes sense for static + # builds. Tracking dependencies for shared builds is more involved. + if(NOT BUILD_SHARED_LIBS) + add_custom_target(install_tools + COMMAND ${CMAKE_COMMAND} + --install ${CMAKE_BINARY_DIR} --component host_tools + ) + add_custom_target(install_tools_stripped + COMMAND ${CMAKE_COMMAND} + --install ${CMAKE_BINARY_DIR} --component host_tools --strip + ) + if(NOT QT_INTERNAL_NO_INSTALL_TOOLS_BUILD_DEPS) + add_dependencies(install_tools host_tools) + add_dependencies(install_tools_stripped host_tools) + endif() + endif() endif() # Add benchmark meta target. It's collection of all benchmarks added/registered by diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index a974b6784ae..1d0d93a071c 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -215,7 +215,9 @@ function(qt_internal_add_tool target_name) qt_get_cmake_configurations(cmake_configs) set(install_initial_call_args - EXPORT "${INSTALL_CMAKE_NAMESPACE}${arg_TOOLS_TARGET}ToolsTargets") + EXPORT "${INSTALL_CMAKE_NAMESPACE}${arg_TOOLS_TARGET}ToolsTargets" + COMPONENT host_tools + ) foreach(cmake_config ${cmake_configs}) qt_get_install_target_default_args(