summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-04-27 10:56:13 +0200
committerKai Koehne <kai.koehne@qt.io>2020-05-05 08:33:40 +0200
commitfcceae605a3dc4ec4bb501cca8b290f7e1d2936b (patch)
tree77b5288156be13e23417aeab0cebcfb267655a0d /mkspecs/features
parentec2ac17c10416d4f5a265f9899b8012d3bebea01 (diff)
Allow switching of QT_NO_CREATE_VERSIONLESS_TARGETS
Fixes: QTBUG-83774 Change-Id: Ib3f2507a917046426b94a779e205012ce52cbfe9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 309798a767..db18dbece6 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -419,14 +419,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF
!!ENDIF
- # Add a versionless target, for compatibility with Qt6.
- if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::$${CMAKE_MODULE_NAME})
- add_library(Qt::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
- set_target_properties(Qt::$${CMAKE_MODULE_NAME} PROPERTIES
- INTERFACE_LINK_LIBRARIES \"Qt5::$${CMAKE_MODULE_NAME}\"
- )
- endif()
-
!!IF !equals(TEMPLATE, aux)
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
@@ -648,3 +640,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
endif()
+
+# Add a versionless target, for compatibility with Qt6.
+if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND TARGET Qt5::$${CMAKE_MODULE_NAME} AND NOT TARGET Qt::$${CMAKE_MODULE_NAME})
+ add_library(Qt::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
+ set_target_properties(Qt::$${CMAKE_MODULE_NAME} PROPERTIES
+ INTERFACE_LINK_LIBRARIES \"Qt5::$${CMAKE_MODULE_NAME}\"
+ )
+endif()