summaryrefslogtreecommitdiffstats
path: root/cmake/QtExecutableHelpers.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2023-01-03 17:54:18 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2023-01-05 20:01:21 +0100
commit6f7d09677a0759328bd27388c320ff60b45c6aff (patch)
tree3a40e9982a40ad798ec239a3322ee2019a4cd76a /cmake/QtExecutableHelpers.cmake
parent91f18c92d75be6f1fda40778d85f60748eb0c5ca (diff)
Change the RUNTIME_OUTPUT_DIRECTORY for configure-time executables
Set the RUNTIME_OUTPUT_DIRECTORY for configure-time executables so executable will be located inside the QT_BUILD_DIR. This allows to re-build syncqt and make sure ithat ts binary is replaced and located in the libexec directory. Comment on how to rebuild syncqt. Configure-time tools reserve the original tool name for the imported executable. To re-build syncqt use 'syncqt_build' target. Task-number: QTBUG-109792 Change-Id: Id7d912b1d75d18d82cb2a69fbd62b89440120d78 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtExecutableHelpers.cmake')
-rw-r--r--cmake/QtExecutableHelpers.cmake16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake
index 9633cc00a9..d87b60c250 100644
--- a/cmake/QtExecutableHelpers.cmake
+++ b/cmake/QtExecutableHelpers.cmake
@@ -374,8 +374,14 @@ function(qt_internal_add_configure_time_executable target)
set(configure_time_target "${arg_OUTPUT_NAME}")
endif()
set(target_binary "${configure_time_target}${CMAKE_EXECUTABLE_SUFFIX}")
+
+ set(install_dir "${INSTALL_BINDIR}")
+ if(arg_INSTALL_DIRECTORY)
+ set(install_dir "${arg_INSTALL_DIRECTORY}")
+ endif()
+ set(output_directory "${QT_BUILD_DIR}/${install_dir}")
set(target_binary_path
- "${target_binary_dir}/${configuration_path}${target_binary}")
+ "${output_directory}/${configuration_path}${target_binary}")
get_filename_component(target_binary_path "${target_binary_path}" ABSOLUTE)
if(NOT DEFINED arg_SOURCES)
@@ -385,7 +391,7 @@ function(qt_internal_add_configure_time_executable target)
# Timestamp file is required because CMake ignores 'add_custom_command' if we use only the
# binary file as the OUTPUT.
- set(timestamp_file "${target_binary_path}_timestamp")
+ set(timestamp_file "${target_binary_dir}/${target_binary}_timestamp")
add_custom_command(OUTPUT "${target_binary_path}" "${timestamp_file}"
COMMAND
${CMAKE_COMMAND} --build "${target_binary_dir}" ${config_build_arg}
@@ -468,15 +474,11 @@ function(qt_internal_add_configure_time_executable target)
IMPORTED_LOCATION "${target_binary_path}")
if(NOT arg_NO_INSTALL)
- set(install_dir "${INSTALL_BINDIR}")
- if(arg_INSTALL_DIRECTORY)
- set(install_dir "${arg_INSTALL_DIRECTORY}")
- endif()
set_target_properties(${target} PROPERTIES
_qt_internal_configure_time_target_install_location
"${install_dir}/${target_binary}"
)
qt_path_join(target_install_dir ${QT_INSTALL_DIR} ${install_dir})
- qt_copy_or_install(PROGRAMS "${target_binary_path}" DESTINATION "${target_install_dir}")
+ qt_install(PROGRAMS "${target_binary_path}" DESTINATION "${target_install_dir}")
endif()
endfunction()