summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-02 18:39:04 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-02 18:39:04 (GMT)
commit2a6471dd7bf3aa694a9a2bc7f554478d6fdcf8f5 (patch)
tree9f9cc0a1bb5cb21ed1cb40a68058f01007f67906 /Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake
parenta9fd3a107dc4bc34b8d2822b9153ee0ab9e02ea8 (diff)
parent68b674b8bc862f943863b48925a5c4d065de8f39 (diff)
downloadCMake-2a6471dd7bf3aa694a9a2bc7f554478d6fdcf8f5.zip
CMake-2a6471dd7bf3aa694a9a2bc7f554478d6fdcf8f5.tar.gz
CMake-2a6471dd7bf3aa694a9a2bc7f554478d6fdcf8f5.tar.bz2
Merge branch 'master' into ninja-multi-automoc-regression
Diffstat (limited to 'Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake')
-rw-r--r--Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake b/Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake
new file mode 100644
index 0000000..768a82e
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/DirOverridesDisconnected.cmake
@@ -0,0 +1,18 @@
+include(FetchContent)
+
+# Test using saved details. We are re-using a SOURCE_DIR from a previous test
+# so the download command should not be executed.
+FetchContent_Declare(
+ t1
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/savedSrc
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/savedBin
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E false
+)
+FetchContent_Populate(t1)
+
+if(NOT "${t1_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/savedSrc")
+ message(FATAL_ERROR "Wrong SOURCE_DIR returned: ${t1_SOURCE_DIR}")
+endif()
+if(NOT "${t1_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/savedBin")
+ message(FATAL_ERROR "Wrong BINARY_DIR returned: ${t1_BINARY_DIR}")
+endif()