diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-10-11 15:16:57 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-10-11 15:16:57 +0900 |
commit | 915c76ded744c0f5f151402b9fa69f3fd8452573 (patch) | |
tree | ca6a387466543248890f346847acaa8343989b22 /Tests/ExternalProjectSubdir | |
parent | 317dbdb79761ef65e45c7358cfc7571c6afa54ad (diff) | |
download | cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.gz cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.tar.bz2 cmake-915c76ded744c0f5f151402b9fa69f3fd8452573.zip |
Imported Upstream version 3.9.4upstream/3.9.4
Diffstat (limited to 'Tests/ExternalProjectSubdir')
-rw-r--r-- | Tests/ExternalProjectSubdir/CMakeLists.txt | 26 | ||||
-rw-r--r-- | Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt | 14 |
2 files changed, 40 insertions, 0 deletions
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt new file mode 100644 index 000000000..3a67ea018 --- /dev/null +++ b/Tests/ExternalProjectSubdir/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.2) +project(ExternalProjectSubdir NONE) +include(ExternalProject) + +# Remove the custom target output to be sure it runs in an +# incremental test. +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt) + +add_custom_target(PreSubdir1 + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt + ) +add_library(PreSubdir1Interface INTERFACE) +add_dependencies(PreSubdir1Interface PreSubdir1) + +ExternalProject_Add(Subdir1 + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Subdir1 + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Subdir1 + + CMAKE_ARGS -DNORMAL_VAR=NORMAL_VALUE -DGENEX_VAR=$<1:GENEX_VALUE> + LOG_CONFIGURE 1 + + BUILD_COMMAND "" + INSTALL_COMMAND "" + + DEPENDS PreSubdir1Interface + ) diff --git a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt new file mode 100644 index 000000000..2303c3e88 --- /dev/null +++ b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.2) +project(Subdir1 NONE) + +if(NOT "${NORMAL_VAR}" STREQUAL "NORMAL_VALUE") + message(SEND_ERROR "NORMAL_VAR != 'NORMAL_VALUE'") +endif() + +if(NOT "${GENEX_VAR}" STREQUAL "GENEX_VALUE") + message(SEND_ERROR "GENEX_VAR != 'GENEX_VALUE'") +endif() + +if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/../PreSubdir1.txt") + message(SEND_ERROR "../PreSubdir1.txt not provided!") +endif() |