summaryrefslogtreecommitdiff
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-16 18:25:59 +0100
committerBrad King <brad.king@kitware.com>2013-03-18 09:31:33 -0400
commit4aa10cd6d67c051b3659cd33aee17391e4a8318b (patch)
tree3795ec25db9606ad2d7f057b1224ddd30ed4f1fa /Modules/FindQt4.cmake
parent03b0ceebe5f8ca27b54a2d09ad38fb89c298f800 (diff)
downloadcmake-4aa10cd6d67c051b3659cd33aee17391e4a8318b.tar.gz
FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for Qt4::QtCore
With a similar commit in Qt 5, this will error at CMake time if an attempt is made to use target_link_libraries(foo Qt4::QtCore Qt5::Core)
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 1dd2782ed0..4317ce26ec 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1022,6 +1022,12 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
"${QT_MKSPECS_DIR}/default"
${QT_INCLUDE_DIR}
)
+ set_property(TARGET Qt4::QtCore PROPERTY
+ INTERFACE_QT_MAJOR_VERSION 4
+ )
+ set_property(TARGET Qt4::QtCore APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+ )
foreach(QT_MODULE ${QT_MODULES})
_QT4_ADJUST_LIB_VARS(${QT_MODULE})