summaryrefslogtreecommitdiffstats
path: root/cmake/QtQmakeHelpers.cmake
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-09-29 18:07:23 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-10-29 20:26:13 -0700
commita887b7750cc8cb7fcc12e782eb046111f4a78902 (patch)
tree6dedb317ad30f975af90849b0be4c8e13d2593a8 /cmake/QtQmakeHelpers.cmake
parent388136e860c51f0d00026b8be831d562f8193704 (diff)
qconfig.cpp: use qOffsetStringArray
It's been there for ages, we may as well use it and remove unnecessary complexity from CMake. Pick-to: 6.2 Change-Id: I2bbf422288924c198645fffd16a9742567a7e4af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake/QtQmakeHelpers.cmake')
-rw-r--r--cmake/QtQmakeHelpers.cmake37
1 files changed, 12 insertions, 25 deletions
diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake
index 7c5d21ce78..9ad84da5ee 100644
--- a/cmake/QtQmakeHelpers.cmake
+++ b/cmake/QtQmakeHelpers.cmake
@@ -13,35 +13,22 @@ function(qt_to_qmake_path_list out_var)
set("${out_var}" "${result}" PARENT_SCOPE)
endfunction()
-macro(qt_add_string_to_qconfig_cpp str)
- string(LENGTH "${str}" length)
- string(APPEND QT_CONFIG_STRS " \"${str}\\0\"\n")
- string(APPEND QT_CONFIG_STR_OFFSETS " ${QT_CONFIG_STR_OFFSET},\n")
- math(EXPR QT_CONFIG_STR_OFFSET "${QT_CONFIG_STR_OFFSET}+${length}+1")
-endmacro()
function(qt_generate_qconfig_cpp in_file out_file)
- set(QT_CONFIG_STR_OFFSET "0")
- set(QT_CONFIG_STR_OFFSETS "")
set(QT_CONFIG_STRS "")
- # Start first part.
- qt_add_string_to_qconfig_cpp("${INSTALL_DOCDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_INCLUDEDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_LIBDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_LIBEXECDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_BINDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_PLUGINSDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_QMLDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_ARCHDATADIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_DATADIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_TRANSLATIONSDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_EXAMPLESDIR}")
- qt_add_string_to_qconfig_cpp("${INSTALL_TESTSDIR}")
-
- # Save first part.
- set(QT_CONFIG_STR_OFFSETS_FIRST "${QT_CONFIG_STR_OFFSETS}")
- set(QT_CONFIG_STRS_FIRST "${QT_CONFIG_STRS}")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_DOCDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_INCLUDEDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_LIBDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_LIBEXECDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_BINDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_PLUGINSDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_QMLDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_ARCHDATADIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_DATADIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_TRANSLATIONSDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_EXAMPLESDIR}\",\n")
+ string(APPEND QT_CONFIG_STRS " \"${INSTALL_TESTSDIR}\"")
# Settings path / sysconf dir.
set(QT_SYS_CONF_DIR "${INSTALL_SYSCONFDIR}")