summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/SourceDirChange.cmake
blob: 62213cde580762721fee08b5e1cbef9889b4ef22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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   ""
)