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.

Pick-to: 6.8
Change-Id: I1586bf192a4fd26108aa0448431f19e69df8aacd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Joerg Bornemann 2024-11-08 15:48:24 +01:00
parent 18a217af4a
commit 14fc7f0852
2 changed files with 6 additions and 0 deletions

View File

@ -767,6 +767,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

@ -415,6 +415,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()