diff options
author | Brad King <brad.king@kitware.com> | 2017-01-20 16:54:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-01-20 16:54:31 (GMT) |
commit | 910ef6d0a3eab5d483759ee23f10e91f1c4da8c2 (patch) | |
tree | 867a64a159d765142eb2bc15b9a068681aab5964 /Tests | |
parent | 22d240184cfe5afda325551b68610bf7160afa8b (diff) | |
parent | d9f836e9567dbcce85b917300e8de9086aa1f1f7 (diff) | |
download | CMake-910ef6d0a3eab5d483759ee23f10e91f1c4da8c2.zip CMake-910ef6d0a3eab5d483759ee23f10e91f1c4da8c2.tar.gz CMake-910ef6d0a3eab5d483759ee23f10e91f1c4da8c2.tar.bz2 |
Merge topic '16165-manually-added-dependencies'
d9f836e9 Add a getter for manually added target dependencies
Diffstat (limited to 'Tests')
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() +{ +} |