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 10:24:57 +0100 |
commit | c19d957f45fa27f61b5ecc566f8dbc19f12a44c3 (patch) | |
tree | f68f3eb9707ac5e2fe8f3fc22b261e7a8d955d18 /cmake/QtCMakeHelpers.cmake | |
parent | 74b7d5643f78ee3bda8d3b2b47d2b9fd539cdd5a (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.
Pick-to: dev
Task-number: QTBUG-89170
Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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}") |