The targets added by commit v3.6.0-rc1~240^2~2 (Ninja: Add `$subdir/all` targets, 2016-03-11) use as `$subdir` the relative path from the top of the source tree to the current source directory. This is not correct when using `add_subdirectory(test test_bin)`. Instead we need to use the relative path from the top of the binary tree to the current binary directory as was done for related targets by commit v3.7.0-rc1~268^2 (Ninja: Add `$subdir/{test,install,package}` targets, 2016-08-05).
9 lines
300 B
CMake
9 lines
300 B
CMake
include(CTest)
|
|
add_subdirectory(SubDir)
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/SubDirSource SubDirBinary)
|
|
add_custom_target(TopFail ALL COMMAND does_not_exist)
|
|
add_test(NAME TopTest COMMAND ${CMAKE_COMMAND} -E echo "Running TopTest")
|
|
install(CODE [[
|
|
message(FATAL_ERROR "Installing Top")
|
|
]])
|