summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-03 12:26:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-08 06:03:29 (GMT)
commit77f3772784152701ff0eee5e4a19177996c03c0e (patch)
treec20abe0601fc037887e11b7c2ef6f20c21596801 /Tests
parent2e60b5fcf7929232c2e731f21e1ab9a889949fa3 (diff)
downloadCMake-77f3772784152701ff0eee5e4a19177996c03c0e.zip
CMake-77f3772784152701ff0eee5e4a19177996c03c0e.tar.gz
CMake-77f3772784152701ff0eee5e4a19177996c03c0e.tar.bz2
cmTarget: Require a compatible INTERFACE_AUTOUIC_OPTIONS from dependencies.
Revert the origin-tracking infrastructure from commit 98093c45 (QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property., 2013-11-20). Use the compatibility-tracking for compatible strings instead. If two different dependencies require different AUTOUIC_OPTIONS, cmake will now appropriately issue an error.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CompatibleInterface/AutoUic-result.txt1
-rw-r--r--Tests/RunCMake/CompatibleInterface/AutoUic-stderr.txt11
-rw-r--r--Tests/RunCMake/CompatibleInterface/AutoUic.cmake22
-rw-r--r--Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CompatibleInterface/empty.cpp1
6 files changed, 43 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 593921f..96b0543 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -94,6 +94,9 @@ if(NOT WIN32)
add_RunCMake_test(VisibilityPreset)
endif()
endif()
+if (QT4_FOUND)
+ set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
+endif()
add_RunCMake_test(CompatibleInterface)
add_RunCMake_test(Syntax)
diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic-result.txt b/Tests/RunCMake/CompatibleInterface/AutoUic-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/AutoUic-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic-stderr.txt b/Tests/RunCMake/CompatibleInterface/AutoUic-stderr.txt
new file mode 100644
index 0000000..09f9461
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/AutoUic-stderr.txt
@@ -0,0 +1,11 @@
+CMake Error: The INTERFACE_AUTOUIC_OPTIONS property of "OtherI18n" does
+not agree with the value of AUTOUIC_OPTIONS already determined
+for "LibWidget".
+
+CMake Debug Log:
+ String compatibility of property "AUTOUIC_OPTIONS" for target "LibWidget"
+ \(result: "-tr;ki18n"\):
+
+ \* Target "LibWidget" property not set.
+ \* Target "KI18n" property value "-tr;ki18n" \(Interface set\)
+ \* Target "OtherI18n" property value "-tr;otheri18n" \(Disagree\)
diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake
new file mode 100644
index 0000000..86bd5a0
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake
@@ -0,0 +1,22 @@
+
+find_package(Qt4 REQUIRED)
+
+set(QT_CORE_TARGET Qt4::QtCore)
+set(QT_GUI_TARGET Qt4::QtGui)
+
+set(CMAKE_AUTOUIC ON)
+
+set(CMAKE_DEBUG_TARGET_PROPERTIES AUTOUIC_OPTIONS)
+
+add_library(KI18n INTERFACE)
+set_property(TARGET KI18n APPEND PROPERTY
+ INTERFACE_AUTOUIC_OPTIONS -tr ki18n
+)
+
+add_library(OtherI18n INTERFACE)
+set_property(TARGET OtherI18n APPEND PROPERTY
+ INTERFACE_AUTOUIC_OPTIONS -tr otheri18n
+)
+
+add_library(LibWidget empty.cpp)
+target_link_libraries(LibWidget KI18n OtherI18n ${QT_GUI_TARGET})
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index ff2fe8d..b87adc8 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -10,3 +10,8 @@ run_cmake(InterfaceString-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
run_cmake(DebugProperties)
+
+if (QT_QMAKE_EXECUTABLE})
+ set(RunCMake_TEST_OPTIONS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
+ run_cmake(AutoUic)
+endif()
diff --git a/Tests/RunCMake/CompatibleInterface/empty.cpp b/Tests/RunCMake/CompatibleInterface/empty.cpp
new file mode 100644
index 0000000..0032329
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/empty.cpp
@@ -0,0 +1 @@
+// no content