summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-05 12:24:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-08 06:03:29 (GMT)
commit2e60b5fcf7929232c2e731f21e1ab9a889949fa3 (patch)
tree48025bae9d4f68cc8f003fd693d907266b10c6ba /Tests
parent7974dbb0ffe9c4abb314ec6baff4f0af1d99e5f5 (diff)
downloadCMake-2e60b5fcf7929232c2e731f21e1ab9a889949fa3.zip
CMake-2e60b5fcf7929232c2e731f21e1ab9a889949fa3.tar.gz
CMake-2e60b5fcf7929232c2e731f21e1ab9a889949fa3.tar.bz2
cmTarget: Report origin of COMPATIBLE_INTERFACE properties.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CompatibleInterface/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CompatibleInterface/DebugProperties-result.txt1
-rw-r--r--Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt73
-rw-r--r--Tests/RunCMake/CompatibleInterface/DebugProperties.cmake60
-rw-r--r--Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Debug-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Debug-stderr.txt6
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Debug.cmake8
-rw-r--r--Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake1
9 files changed, 158 insertions, 0 deletions
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 8186c61..5e64d2a 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -31,6 +31,13 @@ set_property(TARGET iface1 APPEND PROPERTY
NUMBER_MAX_PROP2
)
+set(CMAKE_DEBUG_TARGET_PROPERTIES
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
+ STRING_PROP1 STRING_PROP2 STRING_PROP3
+ NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
+ NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
+)
+
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-result.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
new file mode 100644
index 0000000..0044564
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -0,0 +1,73 @@
+CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP1" for target
+ "CompatibleInterface" \(result: "TRUE"\):
+
+ \* Target "CompatibleInterface" property not set.
+ \* Target "iface1" property value "TRUE" \(Interface set\)
++
+CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP2" for target
+ "CompatibleInterface" \(result: "TRUE"\):
+
+ \* Target "CompatibleInterface" has property content "TRUE"
+ \* Target "iface1" property value "TRUE" \(Agree\)
++
+CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP3" for target
+ "CompatibleInterface" \(result: "TRUE"\):
+
+ \* Target "CompatibleInterface" has property content "TRUE"
++
+CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP4" for target
+ "CompatibleInterface" \(result: "FALSE"\):
+
+ \* Target "CompatibleInterface" property not set.
++
+CMake Debug Log:
+ String compatibility of property "STRING_PROP1" for target
+ "CompatibleInterface" \(result: "prop1"\):
+
+ \* Target "CompatibleInterface" property not set.
+ \* Target "iface1" property value "prop1" \(Interface set\)
++
+CMake Debug Log:
+ String compatibility of property "STRING_PROP2" for target
+ "CompatibleInterface" \(result: "prop2"\):
+
+ \* Target "CompatibleInterface" has property content "prop2"
+ \* Target "iface1" property value "prop2" \(Agree\)
++
+CMake Debug Log:
+ String compatibility of property "STRING_PROP3" for target
+ "CompatibleInterface" \(result: "prop3"\):
+
+ \* Target "CompatibleInterface" has property content "prop3"
++
+CMake Debug Log:
+ Numeric minimum compatibility of property "NUMBER_MIN_PROP1" for target
+ "CompatibleInterface" \(result: "50"\):
+
+ \* Target "CompatibleInterface" has property content "50"
+ \* Target "iface1" property value "100" \(Ignored\)
++
+CMake Debug Log:
+ Numeric minimum compatibility of property "NUMBER_MIN_PROP2" for target
+ "CompatibleInterface" \(result: "200"\):
+
+ \* Target "CompatibleInterface" has property content "250"
+ \* Target "iface1" property value "200" \(Dominant\)
++
+CMake Debug Log:
+ Numeric maximum compatibility of property "NUMBER_MAX_PROP1" for target
+ "CompatibleInterface" \(result: "100"\):
+
+ \* Target "CompatibleInterface" has property content "50"
+ \* Target "iface1" property value "100" \(Dominant\)
++
+CMake Debug Log:
+ Numeric maximum compatibility of property "NUMBER_MAX_PROP2" for target
+ "CompatibleInterface" \(result: "250"\):
+
+ \* Target "CompatibleInterface" has property content "250"
+ \* Target "iface1" property value "200" \(Ignored\)
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
new file mode 100644
index 0000000..3214d8e
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -0,0 +1,60 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(CompatibleInterface)
+
+include(GenerateExportHeader)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_library(iface1 INTERFACE)
+set_property(TARGET iface1 APPEND PROPERTY
+ COMPATIBLE_INTERFACE_BOOL
+ BOOL_PROP1
+ BOOL_PROP2
+ BOOL_PROP3
+ BOOL_PROP4
+)
+set_property(TARGET iface1 APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING
+ STRING_PROP1
+ STRING_PROP2
+ STRING_PROP3
+)
+set_property(TARGET iface1 APPEND PROPERTY
+ COMPATIBLE_INTERFACE_NUMBER_MIN
+ NUMBER_MIN_PROP1
+ NUMBER_MIN_PROP2
+)
+set_property(TARGET iface1 APPEND PROPERTY
+ COMPATIBLE_INTERFACE_NUMBER_MAX
+ NUMBER_MAX_PROP1
+ NUMBER_MAX_PROP2
+)
+
+set(CMAKE_DEBUG_TARGET_PROPERTIES
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
+ STRING_PROP1 STRING_PROP2 STRING_PROP3
+ NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
+ NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
+)
+
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
+set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
+set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
+
+add_executable(CompatibleInterface empty.cpp)
+target_link_libraries(CompatibleInterface iface1)
+
+set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON)
+set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON)
+set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2)
+set_property(TARGET CompatibleInterface PROPERTY STRING_PROP3 prop3)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP1 50)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP2 250)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP1 50)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP2 250)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index 9768151..ff2fe8d 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -9,3 +9,4 @@ run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
+run_cmake(DebugProperties)
diff --git a/Tests/RunCMake/PositionIndependentCode/Debug-result.txt b/Tests/RunCMake/PositionIndependentCode/Debug-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Debug-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/PositionIndependentCode/Debug-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Debug-stderr.txt
new file mode 100644
index 0000000..774445b
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Debug-stderr.txt
@@ -0,0 +1,6 @@
+CMake Debug Log:
+ Boolean compatibility of property "POSITION_INDEPENDENT_CODE" for target
+ "foo" \(result: "TRUE"\):
+
+ \* Target "foo" has property content "TRUE"
+ \* Target "iface" property value "TRUE" \(Agree\)
diff --git a/Tests/RunCMake/PositionIndependentCode/Debug.cmake b/Tests/RunCMake/PositionIndependentCode/Debug.cmake
new file mode 100644
index 0000000..4a8fbac
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Debug.cmake
@@ -0,0 +1,8 @@
+
+add_library(iface INTERFACE)
+set_property(TARGET iface PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+set(CMAKE_DEBUG_TARGET_PROPERTIES POSITION_INDEPENDENT_CODE)
+add_library(foo main.cpp)
+target_link_libraries(foo iface)
+set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE ON)
diff --git a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
index 3a2009b..6a67e3c 100644
--- a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
@@ -6,3 +6,4 @@ run_cmake(Conflict3)
run_cmake(Conflict4)
run_cmake(Conflict5)
run_cmake(Conflict6)
+run_cmake(Debug)