diff options
author | Cristian Le <[email protected]> | 2025-01-13 17:18:02 +0100 |
---|---|---|
committer | Cristian Le <[email protected]> | 2025-06-25 23:32:03 +0200 |
commit | 1ce2841fc1695325f6213d213f2d8dbf5d653c18 (patch) | |
tree | f3e6958a9451dda478d106c400a5c32a1521a128 | |
parent | 8c51259a7beafab1f1ba16c9247642bfd63518c3 (diff) |
Install `user_facing_tool_links.txt` automatically
The installation is already gated by the user having to specify
`INSTALL_PUBLICBINDIR`, at which point we know that they want symlinks
created and installed. This automates the installation for that user.
Fixes: QTBUG-132761
Change-Id: Ie1242f21ec39db8fc0f31d7f2b93a43a23533485
Reviewed-by: Alexandru Croitor <[email protected]>
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 5d8e299023d..9f220f9d78b 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -881,6 +881,11 @@ function(qt_internal_generate_user_facing_tools_info) qt_path_join(tool_link_base_dir "${CMAKE_INSTALL_PREFIX}" "${INSTALL_PUBLICBINDIR}") get_property(user_facing_tool_targets GLOBAL PROPERTY QT_USER_FACING_TOOL_TARGETS) set(lines "") + set(cmake_install_script "${PROJECT_BINARY_DIR}/install_user_facing_tool_links.cmake") + set(cmake_install_script_content +"execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E make_directory + \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_PUBLICBINDIR}\") +") foreach(target ${user_facing_tool_targets}) get_target_property(filename ${target} OUTPUT_NAME) if(NOT filename) @@ -897,9 +902,17 @@ function(qt_internal_generate_user_facing_tools_info) qt_path_join(tool_link_path "${INSTALL_PUBLICBINDIR}" "${linkname}${PROJECT_VERSION_MAJOR}") _qt_internal_relative_path(tool_target_path BASE_DIRECTORY ${tool_link_base_dir}) list(APPEND lines "${tool_target_path} ${tool_link_path}") + string(APPEND cmake_install_script_content +"execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink + \"${tool_target_path}\" \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${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}") + qt_configure_file(OUTPUT "${cmake_install_script}" + CONTENT "${cmake_install_script_content}" + ) + install(SCRIPT ${cmake_install_script}) endfunction() |