diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-13 19:52:21 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-02 21:14:02 (GMT) |
commit | 3676fb49634efd01755aa5c12d58e2f2bf20d09f (patch) | |
tree | 9fa46bbd284083457ce0133ff27d03fd710e9c76 /Tests | |
parent | e6971df6ab647031ba9689c9afbbde78cc62e35f (diff) | |
download | CMake-3676fb49634efd01755aa5c12d58e2f2bf20d09f.zip CMake-3676fb49634efd01755aa5c12d58e2f2bf20d09f.tar.gz CMake-3676fb49634efd01755aa5c12d58e2f2bf20d09f.tar.bz2 |
cmTarget: Allow transitive evaluation of SOURCES property.
Extend the cmGeneratorExpressionDAGChecker with an interface
returning the name of the top target. Use that to determine
when there is a DAG violation, as required by the RunCMake.Languages
tests.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ConfigSources/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/ConfigSources/iface_debug.h | 4 | ||||
-rw-r--r-- | Tests/ConfigSources/iface_debug_src.cpp | 7 | ||||
-rw-r--r-- | Tests/ConfigSources/iface_src.cpp | 5 | ||||
-rw-r--r-- | Tests/ConfigSources/main.cpp | 4 | ||||
-rw-r--r-- | Tests/SourcesProperty/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/SourcesProperty/iface.cpp | 5 | ||||
-rw-r--r-- | Tests/SourcesProperty/iface.h | 2 | ||||
-rw-r--r-- | Tests/SourcesProperty/main.cpp | 7 |
10 files changed, 52 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e77133a..1c474ab 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -282,6 +282,7 @@ if(BUILD_TESTING) set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=Debug) ADD_TEST_MACRO(ConfigSources ConfigSources) endif() + ADD_TEST_MACRO(SourcesProperty SourcesProperty) set_tests_properties(EmptyLibrary PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target: test") ADD_TEST_MACRO(CrossCompile CrossCompile) diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt index 68a4233..c272257 100644 --- a/Tests/ConfigSources/CMakeLists.txt +++ b/Tests/ConfigSources/CMakeLists.txt @@ -3,7 +3,15 @@ cmake_minimum_required(VERSION 3.0) project(ConfigSources) +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES + iface_src.cpp + $<$<CONFIG:Debug>:iface_debug_src.cpp> + $<$<CONFIG:Release>:does_not_exist.cpp> +) + add_executable(ConfigSources $<$<CONFIG:Debug>:main.cpp> $<$<CONFIG:Release>:does_not_exist.cpp> ) +target_link_libraries(ConfigSources iface) diff --git a/Tests/ConfigSources/iface_debug.h b/Tests/ConfigSources/iface_debug.h new file mode 100644 index 0000000..a23d737 --- /dev/null +++ b/Tests/ConfigSources/iface_debug.h @@ -0,0 +1,4 @@ + +int iface_src(); + +int iface_debug(); diff --git a/Tests/ConfigSources/iface_debug_src.cpp b/Tests/ConfigSources/iface_debug_src.cpp new file mode 100644 index 0000000..63b22fc --- /dev/null +++ b/Tests/ConfigSources/iface_debug_src.cpp @@ -0,0 +1,7 @@ + +#include "iface_debug.h" + +int iface_debug() +{ + return 0; +} diff --git a/Tests/ConfigSources/iface_src.cpp b/Tests/ConfigSources/iface_src.cpp new file mode 100644 index 0000000..c3a0c8f --- /dev/null +++ b/Tests/ConfigSources/iface_src.cpp @@ -0,0 +1,5 @@ + +int iface_src() +{ + return 0; +} diff --git a/Tests/ConfigSources/main.cpp b/Tests/ConfigSources/main.cpp index 1c19e8d..71af72f 100644 --- a/Tests/ConfigSources/main.cpp +++ b/Tests/ConfigSources/main.cpp @@ -1,5 +1,7 @@ +#include "iface_debug.h" + int main(int argc, char** argv) { - return 0; + return iface_src() + iface_debug(); } diff --git a/Tests/SourcesProperty/CMakeLists.txt b/Tests/SourcesProperty/CMakeLists.txt new file mode 100644 index 0000000..0b3097e --- /dev/null +++ b/Tests/SourcesProperty/CMakeLists.txt @@ -0,0 +1,10 @@ + +cmake_minimum_required(VERSION 3.0) + +project(SourcesProperty) + +add_library(iface INTERFACE) +set_property(TARGET iface PROPERTY INTERFACE_SOURCES iface.cpp) + +add_executable(SourcesProperty main.cpp) +target_link_libraries(SourcesProperty iface) diff --git a/Tests/SourcesProperty/iface.cpp b/Tests/SourcesProperty/iface.cpp new file mode 100644 index 0000000..e38ac37 --- /dev/null +++ b/Tests/SourcesProperty/iface.cpp @@ -0,0 +1,5 @@ + +int iface() +{ + return 0; +} diff --git a/Tests/SourcesProperty/iface.h b/Tests/SourcesProperty/iface.h new file mode 100644 index 0000000..2cac248 --- /dev/null +++ b/Tests/SourcesProperty/iface.h @@ -0,0 +1,2 @@ + +int iface(); diff --git a/Tests/SourcesProperty/main.cpp b/Tests/SourcesProperty/main.cpp new file mode 100644 index 0000000..ae4f305 --- /dev/null +++ b/Tests/SourcesProperty/main.cpp @@ -0,0 +1,7 @@ + +#include "iface.h" + +int main(int argc, char** argv) +{ + return iface(); +} |