summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-22 13:15:07 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-22 13:21:47 (GMT)
commit0de47b05f74bd12d41b46634f00aea3bcb6f3678 (patch)
treedc5e47bc19c61387a46d01fbf38f3999410ed7de /Tests
parent3541fc73a12a52f87a2faa9790a65651658162d8 (diff)
downloadCMake-0de47b05f74bd12d41b46634f00aea3bcb6f3678.zip
CMake-0de47b05f74bd12d41b46634f00aea3bcb6f3678.tar.gz
CMake-0de47b05f74bd12d41b46634f00aea3bcb6f3678.tar.bz2
ExternalData: Add option to disable use of symlinks
Add an ExternalData_NO_SYMLINKS to enable use of copies instead of symlinks to populate the real data files behind a DATA{} reference. This will be useful on UNIX-like systems when the underlying filesystem does not actually support symbolic links. Suggested-by: Matt McCormick <matt.mccormick@kitware.com>
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Module/ExternalData/CMakeLists.txt1
-rw-r--r--Tests/Module/ExternalData/DataNoSymlinks/CMakeLists.txt8
-rw-r--r--Tests/Module/ExternalData/DataNoSymlinks/Data.dat.md51
-rw-r--r--Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake6
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt
index b6e24d2..f07ab71 100644
--- a/Tests/Module/ExternalData/CMakeLists.txt
+++ b/Tests/Module/ExternalData/CMakeLists.txt
@@ -53,3 +53,4 @@ ExternalData_Add_Target(Data1)
add_subdirectory(Data2)
add_subdirectory(Data3)
add_subdirectory(Data4)
+add_subdirectory(DataNoSymlinks)
diff --git a/Tests/Module/ExternalData/DataNoSymlinks/CMakeLists.txt b/Tests/Module/ExternalData/DataNoSymlinks/CMakeLists.txt
new file mode 100644
index 0000000..d3df7fc
--- /dev/null
+++ b/Tests/Module/ExternalData/DataNoSymlinks/CMakeLists.txt
@@ -0,0 +1,8 @@
+set(ExternalData_NO_SYMLINKS 1)
+ExternalData_Add_Test(DataNoSymlinks
+ NAME DataNoSymlinksCheck
+ COMMAND ${CMAKE_COMMAND}
+ -D Data=DATA{Data.dat}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/DataNoSymlinksCheck.cmake
+ )
+ExternalData_Add_Target(DataNoSymlinks)
diff --git a/Tests/Module/ExternalData/DataNoSymlinks/Data.dat.md5 b/Tests/Module/ExternalData/DataNoSymlinks/Data.dat.md5
new file mode 100644
index 0000000..70e39bd
--- /dev/null
+++ b/Tests/Module/ExternalData/DataNoSymlinks/Data.dat.md5
@@ -0,0 +1 @@
+8c018830e3efa5caf3c7415028335a57
diff --git a/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake b/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake
new file mode 100644
index 0000000..2be3571
--- /dev/null
+++ b/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake
@@ -0,0 +1,6 @@
+if(NOT EXISTS "${Data}")
+ message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!")
+endif()
+if(IS_SYMLINK "${Data}")
+ message(SEND_ERROR "Input file:\n ${Data}\nis a symlink but should not be!")
+endif()