diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-02-26 11:04:00 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-03-25 16:31:39 +0100 |
commit | 9f444ce5335d0e7a0978879d9441975de549e20b (patch) | |
tree | aa8d8b3180127aafca638621f4b8ead4c6b121ca /cmake/QtCMakeHelpers.cmake | |
parent | 9145650302d3cfe7df0fbc2a11f5d8f5f867897d (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/QtCMakeHelpers.cmake')
-rw-r--r-- | cmake/QtCMakeHelpers.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/QtCMakeHelpers.cmake b/cmake/QtCMakeHelpers.cmake index 93513d4369..f9b03d628c 100644 --- a/cmake/QtCMakeHelpers.cmake +++ b/cmake/QtCMakeHelpers.cmake @@ -156,6 +156,26 @@ function(qt_re_escape out_var str) set(${out_var} ${regex} PARENT_SCOPE) endfunction() +# Input: string +# Output: regex string to match the string case insensitively +# Example: "Release" -> "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$" +# +# Regular expressions like this are used in cmake_install.cmake files for case-insensitive string +# comparison. +function(qt_create_case_insensitive_regex out_var input) + set(result "^(") + string(LENGTH "${input}" n) + math(EXPR n "${n} - 1") + foreach(i RANGE 0 ${n}) + string(SUBSTRING "${input}" ${i} 1 c) + string(TOUPPER "${c}" uc) + string(TOLOWER "${c}" lc) + string(APPEND result "[${uc}${lc}]") + endforeach() + string(APPEND result ")$") + set(${out_var} "${result}" PARENT_SCOPE) +endfunction() + # Gets a target property, and returns "" if the property was not found function(qt_internal_get_target_property out_var target property) get_target_property(result "${target}" "${property}") |