From cf01d3d2bd649ab1157641b3212a360b06db747f Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 26 Sep 2019 14:47:53 -0400 Subject: 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. --- Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake | 2 +- Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt | 7 +++---- Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake | 2 +- Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp | 4 ++++ 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 Tests/RunCMake/add_subdirectory/ExcludeFromAll/subinc.cpp 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-$>.c set(main_exe \"$\") set(foo_lib \"$\") set(bar_lib \"$\") -set(baz_lib \"$\") +set(subinc_lib \"$\") ") 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; +} -- cgit v0.12