summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2016-08-15 18:42:22 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-16 17:18:18 (GMT)
commita8345d65f359d75efb057d22976cfb92b4d477cf (patch)
tree5335376db115c6bedbda84cf5169d33ec29ba622 /Tests/CMakeLists.txt
parentf59513140bf086eda2029c5b4e950fc58216c06e (diff)
downloadCMake-a8345d65f359d75efb057d22976cfb92b4d477cf.zip
CMake-a8345d65f359d75efb057d22976cfb92b4d477cf.tar.gz
CMake-a8345d65f359d75efb057d22976cfb92b4d477cf.tar.bz2
ExternalProject: Add SOURCE_SUBDIR option
Add a new SOURCE_SUBDIR option to ExternalProject_Add that allows specifying the location of the CMakeLists.txt to use as the project root relative to the SOURCE_DIR. This is helpful for projects that have unusual layouts, or projects that provide both a superbuild and project-only build depending on which CMakeLists.txt is used. Fixes: #15118
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f21e430..071da41 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1441,6 +1441,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"