summaryrefslogtreecommitdiff
path: root/Tests/CMakeOnly/TargetScope
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 15:39:57 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 15:39:57 -0700
commit035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (patch)
tree7e40f5a790eae329a8c5d3e59f046451767956ff /Tests/CMakeOnly/TargetScope
downloadcmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.gz
cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.bz2
cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.zip
Imported Upstream version 2.8.9upstream/2.8.9
Diffstat (limited to 'Tests/CMakeOnly/TargetScope')
-rw-r--r--Tests/CMakeOnly/TargetScope/CMakeLists.txt13
-rw-r--r--Tests/CMakeOnly/TargetScope/Sib/CMakeLists.txt6
-rw-r--r--Tests/CMakeOnly/TargetScope/Sub/CMakeLists.txt9
-rw-r--r--Tests/CMakeOnly/TargetScope/Sub/Sub/CMakeLists.txt6
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 000000000..fa5d8e234
--- /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 000000000..7f6f4e8fd
--- /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 000000000..27318f585
--- /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 000000000..a351daadf
--- /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()