CMake/Tests/SubDir/Executable/CMakeLists.txt
Stephen Kelly 2bf7de167f Subdirs: Initialize from parent before configuring.
Add new API for the subdirs command to cmState.

This fixes a regression introduced in commit f716460e (cmMakefile: Move
invokation to initialize snapshot., 2015-10-06).
2015-10-14 00:34:11 +02:00

14 lines
463 B
CMake

add_executable(test test.cxx)
if (NOT DEFINED_AFTER_SUBDIRS_COMMAND)
message(FATAL_ERROR "DEFINED_AFTER_SUBDIRS_COMMAND should be defined.")
endif()
string(FIND "${CMAKE_CURRENT_BINARY_DIR}" "SubDir/Executable" location)
string(LENGTH "${CMAKE_CURRENT_BINARY_DIR}" dirLength)
math(EXPR suffixLength "${dirLength} - ${location}")
if (NOT suffixLength EQUAL 17)
message(FATAL_ERROR "CMAKE_CURRENT_BINARY_DIR does not end with \"SubDir/Executable\"")
endif()