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.
This commit is contained in:
Brad King 2019-09-26 14:47:53 -04:00
parent 21442d72a4
commit cf01d3d2bd
4 changed files with 9 additions and 6 deletions

View File

@ -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>\")
")

View File

@ -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)

View File

@ -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}")

View File

@ -0,0 +1,4 @@
int subinc()
{
return 0;
}