summaryrefslogtreecommitdiffstats
path: root/Tests/ExternalProjectSourceSubdir
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/ExternalProjectSourceSubdir
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/ExternalProjectSourceSubdir')
-rw-r--r--Tests/ExternalProjectSourceSubdir/CMakeLists.txt10
-rw-r--r--Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt2
2 files changed, 12 insertions, 0 deletions
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)