summaryrefslogtreecommitdiffstats
path: root/cmake/QtToolHelpers.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-02-26 11:04:00 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-03-25 16:31:39 +0100
commit9f444ce5335d0e7a0978879d9441975de549e20b (patch)
treeaa8d8b3180127aafca638621f4b8ead4c6b121ca /cmake/QtToolHelpers.cmake
parent9145650302d3cfe7df0fbc2a11f5d8f5f867897d (diff)
Add a way to install versioned hard-links for tools
Add the option argument INSTALL_VERSIONED_LINK to qt_internal_add_tool and qt_internal_add_app. For tools/apps with this argument we create an install rule that creates a versioned hard link. For example, for bin/qmake we create bin/qmake6. Note that this only applies to prefix builds. Apply this argument to qmake. The qt_internal_add_app change is necessary for qtdiag and in qttools. Task-number: QTBUG-89170 Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c19d957f45fa27f61b5ecc566f8dbc19f12a44c3)
Diffstat (limited to 'cmake/QtToolHelpers.cmake')
-rw-r--r--cmake/QtToolHelpers.cmake14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake
index 5fcc539b56..21687f5ec1 100644
--- a/cmake/QtToolHelpers.cmake
+++ b/cmake/QtToolHelpers.cmake
@@ -10,7 +10,12 @@
# qt_get_tool_target_name(target_name my_tool)
# qt_internal_add_tool(${target_name})
#
-# Arguments:
+# Option Arguments:
+# INSTALL_VERSIONED_LINK
+# Prefix build only. On installation, create a versioned hard-link of the installed file.
+# E.g. create a link of "bin/qmake6" to "bin/qmake".
+#
+# One-value Arguments:
# EXTRA_CMAKE_FILES
# List of additional CMake files that will be installed alongside the tool's exported CMake
# files.
@@ -23,9 +28,10 @@
#
function(qt_internal_add_tool target_name)
qt_tool_target_to_name(name ${target_name})
+ set(option_keywords BOOTSTRAP NO_INSTALL USER_FACING INSTALL_VERSIONED_LINK)
set(one_value_keywords TOOLS_TARGET EXTRA_CMAKE_FILES INSTALL_DIR
${__default_target_info_args})
- qt_parse_all_arguments(arg "qt_internal_add_tool" "BOOTSTRAP;NO_INSTALL;USER_FACING"
+ qt_parse_all_arguments(arg "qt_internal_add_tool" "${option_keywords}"
"${one_value_keywords}"
"${__default_private_args}" ${ARGN})
@@ -224,6 +230,10 @@ function(qt_internal_add_tool target_name)
unset(install_initial_call_args)
endforeach()
+ if(arg_INSTALL_VERSIONED_LINK)
+ qt_internal_install_versioned_link("${install_dir}" "${target_name}")
+ endif()
+
qt_apply_rpaths(TARGET "${target_name}" INSTALL_PATH "${install_dir}" RELATIVE_RPATH)
endif()