summaryrefslogtreecommitdiffstats
path: root/Tests/SubDir/Executable/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/SubDir/Executable/CMakeLists.txt')
-rw-r--r--Tests/SubDir/Executable/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/SubDir/Executable/CMakeLists.txt b/Tests/SubDir/Executable/CMakeLists.txt
index 77e6751..fbe338e 100644
--- a/Tests/SubDir/Executable/CMakeLists.txt
+++ b/Tests/SubDir/Executable/CMakeLists.txt
@@ -1 +1,13 @@
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()