summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-26 14:47:53 -0400
committerBrad King <brad.king@kitware.com>2019-09-26 14:58:26 -0400
commitcf01d3d2bd649ab1157641b3212a360b06db747f (patch)
tree0bbeed9725d861e441a701d937fbbec6c3da446f
parent21442d72a44c2bd732f2ff19ed89ce488854d25d (diff)
downloadcmake-cf01d3d2bd649ab1157641b3212a360b06db747f.tar.gz
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.
-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 cc31428973..16f39d91bf 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 99add23464..9d7922fd7b 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 2a0179eb12..56a8abd399 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 0000000000..e9faacdba5
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp
@@ -0,0 +1,4 @@
+int subinc()
+{
+ return 0;
+}