[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2533-g2e14151
Stephen Kelly
steveire at gmail.com
Sat Mar 16 13:54:38 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 2e14151262193b285e7294adc9f390ca78a571ed (commit)
via 3393a2d49c8e254d875f12271bf099a4c5619137 (commit)
from 10d45f2091fd33701d27eaa869f6232783169d7e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e14151262193b285e7294adc9f390ca78a571ed
commit 2e14151262193b285e7294adc9f390ca78a571ed
Merge: 10d45f2 3393a2d
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 13:54:30 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 16 13:54:30 2013 -0400
Merge topic 'set-QT_MAJOR_VERSION' into next
3393a2d Set the INTERFACE_QT_MAJOR_VERSION for Qt4::QtCore
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3393a2d49c8e254d875f12271bf099a4c5619137
commit 3393a2d49c8e254d875f12271bf099a4c5619137
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Mar 16 18:25:59 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Mar 16 18:53:54 2013 +0100
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)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 1dd2782..4317ce2 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})
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 4b4bd31..7f9b9fd 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -75,6 +75,12 @@ add_RunCMake_test(include_directories)
add_RunCMake_test(list)
add_RunCMake_test(CMP0004)
+find_package(Qt4 QUIET)
+find_package(Qt5Core QUIET)
+if (QT4_FOUND AND Qt5Core_FOUND AND Qt5Core_VERSION VERSION_GREATER 5.0.2)
+ add_RunCMake_test(IncompatibleQt)
+endif()
+
if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
add_RunCMake_test(include_external_msproject)
add_RunCMake_test(SolutionGlobalSections)
diff --git a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt
new file mode 100644
index 0000000..68dd8d6
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/IncompatibleQt/IncompatibleQt-result.txt b/Tests/RunCMake/IncompatibleQt/IncompatibleQt-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/IncompatibleQt-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/IncompatibleQt/IncompatibleQt-stderr.txt b/Tests/RunCMake/IncompatibleQt/IncompatibleQt-stderr.txt
new file mode 100644
index 0000000..4eaaa95
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/IncompatibleQt-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: The INTERFACE_QT_MAJOR_VERSION property of "Qt5::Core" does
+not agree with the value of QT_MAJOR_VERSION already determined
+for "mainexe".
diff --git a/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake b/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
new file mode 100644
index 0000000..4fccdc4
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
@@ -0,0 +1,6 @@
+
+find_package(Qt4 REQUIRED)
+find_package(Qt5Core REQUIRED)
+
+add_executable(mainexe main.cpp)
+target_link_libraries(mainexe Qt4::QtCore Qt5::Core)
diff --git a/Tests/RunCMake/IncompatibleQt/RunCMakeTest.cmake b/Tests/RunCMake/IncompatibleQt/RunCMakeTest.cmake
new file mode 100644
index 0000000..322c291
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(IncompatibleQt)
diff --git a/Tests/RunCMake/IncompatibleQt/main.cpp b/Tests/RunCMake/IncompatibleQt/main.cpp
new file mode 100644
index 0000000..140a7c1
--- /dev/null
+++ b/Tests/RunCMake/IncompatibleQt/main.cpp
@@ -0,0 +1,8 @@
+
+#include <QCoreApplication>
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+ return app.exec();
+}
-----------------------------------------------------------------------
Summary of changes:
Modules/FindQt4.cmake | 6 ++++++
Tests/RunCMake/CMakeLists.txt | 6 ++++++
.../CMakeLists.txt | 0
.../IncompatibleQt-result.txt} | 0
.../IncompatibleQt/IncompatibleQt-stderr.txt | 3 +++
Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake | 6 ++++++
Tests/RunCMake/IncompatibleQt/RunCMakeTest.cmake | 3 +++
Tests/RunCMake/IncompatibleQt/main.cpp | 8 ++++++++
8 files changed, 32 insertions(+), 0 deletions(-)
copy Tests/RunCMake/{CompatibleInterface => IncompatibleQt}/CMakeLists.txt (100%)
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => IncompatibleQt/IncompatibleQt-result.txt} (100%)
create mode 100644 Tests/RunCMake/IncompatibleQt/IncompatibleQt-stderr.txt
create mode 100644 Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
create mode 100644 Tests/RunCMake/IncompatibleQt/RunCMakeTest.cmake
create mode 100644 Tests/RunCMake/IncompatibleQt/main.cpp
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list