summaryrefslogtreecommitdiffstats
path: root/Tests/SubDir
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-12 17:34:06 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-13 22:34:11 (GMT)
commit2bf7de167f0b72b07c6246679c964d83cdc47d45 (patch)
treee2a9b990f9134adeeac21b58e61c6e103a1eb9a6 /Tests/SubDir
parent0aa34de5493732d219dd3f58634222677bd19e22 (diff)
downloadCMake-2bf7de167f0b72b07c6246679c964d83cdc47d45.zip
CMake-2bf7de167f0b72b07c6246679c964d83cdc47d45.tar.gz
CMake-2bf7de167f0b72b07c6246679c964d83cdc47d45.tar.bz2
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).
Diffstat (limited to 'Tests/SubDir')
-rw-r--r--Tests/SubDir/CMakeLists.txt4
-rw-r--r--Tests/SubDir/Executable/CMakeLists.txt12
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
index 6822e6b..32aa93f 100644
--- a/Tests/SubDir/CMakeLists.txt
+++ b/Tests/SubDir/CMakeLists.txt
@@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 2.6)
project(SUBDIR)
+
subdirs(Executable EXCLUDE_FROM_ALL Examples)
+
+set(DEFINED_AFTER_SUBDIRS_COMMAND 42)
+
write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
#WATCOM WMAKE does not support + in the name of a file!
if(WATCOM)
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()