diff options
author | Brad King <brad.king@kitware.com> | 2012-01-25 19:04:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-01-25 19:43:07 (GMT) |
commit | f9c1c6225c4366918465b86e4c6976ecc266245f (patch) | |
tree | 820b625dc0f55181f8deef886ca7fc7686074ab3 /Tests/CMakeOnly/TargetScope | |
parent | ca39c5cdd1ca28516791e00f213d6dee2179c6df (diff) | |
download | CMake-f9c1c6225c4366918465b86e4c6976ecc266245f.zip CMake-f9c1c6225c4366918465b86e4c6976ecc266245f.tar.gz CMake-f9c1c6225c4366918465b86e4c6976ecc266245f.tar.bz2 |
Add test covering imported target scope rules
Diffstat (limited to 'Tests/CMakeOnly/TargetScope')
-rw-r--r-- | Tests/CMakeOnly/TargetScope/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/CMakeOnly/TargetScope/Sib/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CMakeOnly/TargetScope/Sub/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/CMakeOnly/TargetScope/Sub/Sub/CMakeLists.txt | 6 |
4 files changed, 34 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/TargetScope/CMakeLists.txt b/Tests/CMakeOnly/TargetScope/CMakeLists.txt new file mode 100644 index 0000000..fa5d8e2 --- /dev/null +++ b/Tests/CMakeOnly/TargetScope/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 2.8) +project(TargetScope NONE) + +add_subdirectory(Sub) + +if(TARGET SubLibLocal) + message(FATAL_ERROR "SubLibLocal visible in top directory") +endif() +if(NOT TARGET SubLibGlobal) + message(FATAL_ERROR "SubLibGlobal not visible in top directory") +endif() + +add_subdirectory(Sib) diff --git a/Tests/CMakeOnly/TargetScope/Sib/CMakeLists.txt b/Tests/CMakeOnly/TargetScope/Sib/CMakeLists.txt new file mode 100644 index 0000000..7f6f4e8 --- /dev/null +++ b/Tests/CMakeOnly/TargetScope/Sib/CMakeLists.txt @@ -0,0 +1,6 @@ +if(TARGET SubLibLocal) + message(FATAL_ERROR "SubLibLocal visible in sibling directory") +endif() +if(NOT TARGET SubLibGlobal) + message(FATAL_ERROR "SubLibGlobal not visible in sibling directory") +endif() diff --git a/Tests/CMakeOnly/TargetScope/Sub/CMakeLists.txt b/Tests/CMakeOnly/TargetScope/Sub/CMakeLists.txt new file mode 100644 index 0000000..27318f5 --- /dev/null +++ b/Tests/CMakeOnly/TargetScope/Sub/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library(SubLibLocal UNKNOWN IMPORTED) +add_library(SubLibGlobal UNKNOWN IMPORTED GLOBAL) +add_subdirectory(Sub) +if(NOT TARGET SubLibLocal) + message(FATAL_ERROR "SubLibLocal not visible in own directory") +endif() +if(NOT TARGET SubLibGlobal) + message(FATAL_ERROR "SubLibGlobal not visible in own directory") +endif() diff --git a/Tests/CMakeOnly/TargetScope/Sub/Sub/CMakeLists.txt b/Tests/CMakeOnly/TargetScope/Sub/Sub/CMakeLists.txt new file mode 100644 index 0000000..a351daa --- /dev/null +++ b/Tests/CMakeOnly/TargetScope/Sub/Sub/CMakeLists.txt @@ -0,0 +1,6 @@ +if(NOT TARGET SubLibLocal) + message(FATAL_ERROR "SubLibLocal not visible in subdirectory") +endif() +if(NOT TARGET SubLibGlobal) + message(FATAL_ERROR "SubLibGlobal not visible in subdirectory") +endif() |