summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/SourceDirChange.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/ExternalProject/SourceDirChange.cmake')
-rw-r--r--Tests/RunCMake/ExternalProject/SourceDirChange.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/SourceDirChange.cmake b/Tests/RunCMake/ExternalProject/SourceDirChange.cmake
new file mode 100644
index 0000000..62213cd
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/SourceDirChange.cmake
@@ -0,0 +1,20 @@
+include(ExternalProject)
+
+file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/first")
+file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/second")
+
+if("${SOURCE_DIR_CHANGE}" STREQUAL "")
+ set(source_dir first)
+else()
+ set(source_dir second)
+endif()
+
+ExternalProject_Add(source_dir_change
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/${source_dir}"
+ DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E echo "Download command executed"
+ UPDATE_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ TEST_COMMAND ""
+ INSTALL_COMMAND ""
+)