summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/add_subdirectory
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-26 18:47:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-26 18:58:26 (GMT)
commitcf01d3d2bd649ab1157641b3212a360b06db747f (patch)
tree0bbeed9725d861e441a701d937fbbec6c3da446f /Tests/RunCMake/add_subdirectory
parent21442d72a44c2bd732f2ff19ed89ce488854d25d (diff)
downloadCMake-cf01d3d2bd649ab1157641b3212a360b06db747f.zip
CMake-cf01d3d2bd649ab1157641b3212a360b06db747f.tar.gz
CMake-cf01d3d2bd649ab1157641b3212a360b06db747f.tar.bz2
Tests: Clarify target names in RunCMake.add_subdirectory ExcludeFromAll
Rename the `baz` target to `subinc` to clarify that its role is to be included even though it is in an otherwise excluded subdirectory.
Diffstat (limited to 'Tests/RunCMake/add_subdirectory')
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp4
4 files changed, 9 insertions, 6 deletions
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
index cc31428..16f39d9 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
@@ -9,5 +9,5 @@ file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.c
set(main_exe \"$<TARGET_FILE:main>\")
set(foo_lib \"$<TARGET_FILE:foo>\")
set(bar_lib \"$<TARGET_FILE:bar>\")
-set(baz_lib \"$<TARGET_FILE:baz>\")
+set(subinc_lib \"$<TARGET_FILE:subinc>\")
")
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
index 99add23..9d7922f 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
@@ -1,8 +1,7 @@
add_library(bar STATIC bar.cpp)
add_library(foo STATIC foo.cpp)
-
-add_library(baz STATIC foo.cpp)
-set_target_properties(baz PROPERTIES EXCLUDE_FROM_ALL OFF)
-
target_include_directories(foo PUBLIC .)
+
+add_library(subinc STATIC subinc.cpp)
+set_target_properties(subinc PROPERTIES EXCLUDE_FROM_ALL OFF)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
index 2a0179e..56a8abd 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
@@ -6,7 +6,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
foreach(file
"${foo_lib}"
- "${baz_lib}"
+ "${subinc_lib}"
"${main_exe}"
)
if(NOT EXISTS "${file}")
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp
new file mode 100644
index 0000000..e9faacd
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp
@@ -0,0 +1,4 @@
+int subinc()
+{
+ return 0;
+}