Avoid error with CMake < 3.12

This commit is contained in:
Martchus 2021-04-06 18:11:21 +02:00
parent 144cec5562
commit 7792012916
1 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,11 @@ function (query_qmake_variable_path QMAKE_VARIABLE)
# assume VARIABLE_VALUE is relative within CMAKE_FIND_ROOT_PATH, e.g. QT_INSTALL_TRANSLATIONS might be set to
# "share/qt6/translations"
if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
message(
WARNING "Unable to resolve Qt variable ${QMAKE_VARIABLE} to an existing path, try using CMake 3.12 or newer")
return() # skip if CMake version too old like on Leap 15.1
endif ()
foreach (ROOT_PATH ${CMAKE_FIND_ROOT_PATH} "")
foreach (PREFIX_PATH ${CMAKE_PREFIX_PATH} "")
string(JOIN "/" FULL_PATH ${ROOT_PATH} ${PREFIX_PATH} ${VARIABLE_VALUE})