From 6f7d09677a0759328bd27388c320ff60b45c6aff Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 3 Jan 2023 17:54:18 +0100 Subject: Change the RUNTIME_OUTPUT_DIRECTORY for configure-time executables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- cmake/QtExecutableHelpers.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cmake/QtExecutableHelpers.cmake') 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() -- cgit v1.2.3