summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-16 17:26:22 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-16 17:26:22 (GMT)
commite240a7c0176450e092e2398148c1e13f8940c239 (patch)
tree0a2c888b25c8c1db3e4326662d06198b8ddfb444 /Tests
parent074d098ffb001c6e6c03483746c7bb6e02ab4484 (diff)
parenta8345d65f359d75efb057d22976cfb92b4d477cf (diff)
downloadCMake-e240a7c0176450e092e2398148c1e13f8940c239.zip
CMake-e240a7c0176450e092e2398148c1e13f8940c239.tar.gz
CMake-e240a7c0176450e092e2398148c1e13f8940c239.tar.bz2
Merge topic 'ExternalProject-SOURCE_SUBDIR'
a8345d65 ExternalProject: Add SOURCE_SUBDIR option
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/ExternalProjectSourceSubdir/CMakeLists.txt10
-rw-r--r--Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt2
3 files changed, 24 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2d234db..6f1805b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1464,6 +1464,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
+ add_test(NAME ExternalProjectSourceSubdir
+ COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ExternalProjectSourceSubdir"
+ "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir"
+ ${build_generator_args}
+ --build-project ExternalProjectSourceSubdir
+ --force-new-ctest-process
+ --build-options ${build_options}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir")
+
add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal"
diff --git a/Tests/ExternalProjectSourceSubdir/CMakeLists.txt b/Tests/ExternalProjectSourceSubdir/CMakeLists.txt
new file mode 100644
index 0000000..4688acf
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdir/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.6)
+project(ExternalProjectSourceSubdir NONE)
+include(ExternalProject)
+
+ExternalProject_Add(Example
+ SOURCE_SUBDIR subdir
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Example
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Example
+ INSTALL_COMMAND ""
+ )
diff --git a/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt b/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt
new file mode 100644
index 0000000..bbc3ca0
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.0)
+project(empty)