summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CompatibleInterface
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-27 00:29:52 +0100
committerStephen Kelly <steveire@gmail.com>2014-01-04 11:28:57 +0100
commit79db8ef78d567e518295abc0ffff3140103203b3 (patch)
treebd2d88d22871cca720e65e1b7a83cc0d696064c5 /Tests/RunCMake/CompatibleInterface
parent43340a9c96212559e83d347b9e3ecebf98ed8aac (diff)
downloadcmake-79db8ef78d567e518295abc0ffff3140103203b3.tar.gz
cmTarget: Fix the property compatibility error message
Don't refer to 'both', but a 'mixture'. List all compatible interface property types possible. Add another test for a mixture of three compatibilities.
Diffstat (limited to 'Tests/RunCMake/CompatibleInterface')
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt3
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake3
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt1
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt7
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake9
-rw-r--r--Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake1
6 files changed, 21 insertions, 3 deletions
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
index 5a8f99df22..900e3f89e5 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
@@ -2,4 +2,5 @@ CMake Error in CMakeLists.txt:
Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the
COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user".
This is not allowed. A property may only require compatibility in a
- boolean interpretation or a string interpretation, but not both.
+ boolean interpretation, a numeric minimum, a numeric maximum or a string
+ interpretation, but not a mixture.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
index 711368a807..4bae8042d7 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
@@ -1,9 +1,8 @@
add_library(foo UNKNOWN IMPORTED)
-add_library(bar UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
add_executable(user main.cpp)
-target_link_libraries(user foo bar)
+target_link_libraries(user foo)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
new file mode 100644
index 0000000000..2cfbae4766
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error in CMakeLists.txt:
+ Property "OTHER" appears in both the COMPATIBLE_INTERFACE_BOOL,
+ COMPATIBLE_INTERFACE_NUMBER_MIN and the COMPATIBLE_INTERFACE_STRING
+ property in the dependencies of target "user". This is not allowed. A
+ property may only require compatibility in a boolean interpretation, a
+ numeric minimum, a numeric maximum or a string interpretation, but not a
+ mixture.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
new file mode 100644
index 0000000000..164ffd9fc6
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
@@ -0,0 +1,9 @@
+
+add_library(foo UNKNOWN IMPORTED)
+
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL OTHER)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING OTHER)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN OTHER)
+
+add_executable(user main.cpp)
+target_link_libraries(user foo)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index b87adc89f6..ec52e5ffaa 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
+run_cmake(InterfaceString-Bool-Min-Conflict)
run_cmake(DebugProperties)
if (QT_QMAKE_EXECUTABLE})