CMake: Fix CMP0177 warnings

CMake 3.31 introduced CMP0177 that warns if an install destination is a
not-normalized path. Fix this by normalizing the offending paths before
using them.

Change-Id: I1586bf192a4fd26108aa0448431f19e69df8aacd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14fc7f0852903109fed8357e2df9edc851f31b65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Joerg Bornemann 2024-11-08 15:48:24 +01:00 committed by Qt Cherry-pick Bot
parent d697e685d8
commit eda1e4b84f
2 changed files with 6 additions and 0 deletions

View File

@ -766,6 +766,9 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
set(args "")
if(QT_WILL_INSTALL)
set(metatypes_install_dir "${INSTALL_ARCHDATADIR}/metatypes")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.31")
cmake_path(SET metatypes_install_dir NORMALIZE "${metatypes_install_dir}")
endif()
list(APPEND args
__QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()

View File

@ -412,6 +412,9 @@ set(core_metatype_args MANUAL_MOC_JSON_FILES ${core_qobject_metatypes_json_list}
if(QT_WILL_INSTALL)
set(metatypes_install_dir ${INSTALL_ARCHDATADIR}/metatypes)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.31")
cmake_path(SET metatypes_install_dir NORMALIZE "${metatypes_install_dir}")
endif()
list(APPEND core_metatype_args
__QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()