summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/add_dependencies/ReadOnlyProperty-result.txt1
-rw-r--r--Tests/RunCMake/add_dependencies/ReadOnlyProperty-stderr.txt1
-rw-r--r--Tests/RunCMake/add_dependencies/ReadOnlyProperty.cmake6
-rw-r--r--Tests/RunCMake/add_dependencies/RetrieveDependencies.cmake16
-rw-r--r--Tests/RunCMake/add_dependencies/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/add_dependencies/a.c3
-rw-r--r--Tests/RunCMake/add_dependencies/b.c3
-rw-r--r--Tests/RunCMake/add_dependencies/c.c3
8 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_dependencies/ReadOnlyProperty-result.txt b/Tests/RunCMake/add_dependencies/ReadOnlyProperty-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/ReadOnlyProperty-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_dependencies/ReadOnlyProperty-stderr.txt b/Tests/RunCMake/add_dependencies/ReadOnlyProperty-stderr.txt
new file mode 100644
index 0000000..da30b81
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/ReadOnlyProperty-stderr.txt
@@ -0,0 +1 @@
+MANUALLY_ADDED_DEPENDENCIES property is read-only
diff --git a/Tests/RunCMake/add_dependencies/ReadOnlyProperty.cmake b/Tests/RunCMake/add_dependencies/ReadOnlyProperty.cmake
new file mode 100644
index 0000000..f0e4069
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/ReadOnlyProperty.cmake
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.7)
+project(ReadOnlyProperty C)
+
+add_library(a a.c)
+
+set_property(TARGET a PROPERTY MANUALLY_ADDED_DEPENDENCIES DEPENDENCIES foo)
diff --git a/Tests/RunCMake/add_dependencies/RetrieveDependencies.cmake b/Tests/RunCMake/add_dependencies/RetrieveDependencies.cmake
new file mode 100644
index 0000000..45b3974
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/RetrieveDependencies.cmake
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.7)
+project(RetrieveDependencies C)
+
+add_library(a a.c)
+
+add_library(b c.c)
+target_link_libraries(a b)
+
+add_library(c c.c)
+add_dependencies(a c)
+
+get_property(DEPS_A TARGET a PROPERTY MANUALLY_ADDED_DEPENDENCIES)
+
+if(NOT DEPS_A STREQUAL "c")
+ message(FATAL_ERROR "Expected target c being a dependency of a but got: '${DEPS_A}'")
+endif()
diff --git a/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
index 30b7e67..507d43f 100644
--- a/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
include(RunCMake)
run_cmake(NoTarget)
+run_cmake(ReadOnlyProperty)
+run_cmake(RetrieveDependencies)
diff --git a/Tests/RunCMake/add_dependencies/a.c b/Tests/RunCMake/add_dependencies/a.c
new file mode 100644
index 0000000..707c1c3
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/a.c
@@ -0,0 +1,3 @@
+void a()
+{
+}
diff --git a/Tests/RunCMake/add_dependencies/b.c b/Tests/RunCMake/add_dependencies/b.c
new file mode 100644
index 0000000..57b2900
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/b.c
@@ -0,0 +1,3 @@
+void b()
+{
+}
diff --git a/Tests/RunCMake/add_dependencies/c.c b/Tests/RunCMake/add_dependencies/c.c
new file mode 100644
index 0000000..cbf94ca
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/c.c
@@ -0,0 +1,3 @@
+void c()
+{
+}