summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalData.cmake
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 /Modules/ExternalData.cmake
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 'Modules/ExternalData.cmake')
-rw-r--r--Modules/ExternalData.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 883ab69..a3f460d 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -117,6 +117,13 @@ calling any of the functions provided by this module.
data fetch rule created for the content link will use the staged
object if it cannot be found using any URL template.
+.. variable:: ExternalData_NO_SYMLINKS
+
+ The real data files named by expanded ``DATA{}`` references may be made
+ available under ``ExternalData_BINARY_ROOT`` using symbolic links on
+ some platforms. The ``ExternalData_NO_SYMLINKS`` variable may be set
+ to disable use of symbolic links and enable use of copies instead.
+
.. variable:: ExternalData_OBJECT_STORES
The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local
@@ -842,7 +849,7 @@ function(_ExternalData_link_or_copy src dst)
file(MAKE_DIRECTORY "${dst_dir}")
_ExternalData_random(random)
set(tmp "${dst}.tmp${random}")
- if(UNIX)
+ if(UNIX AND NOT ExternalData_NO_SYMLINKS)
# Create a symbolic link.
set(tgt "${src}")
if(relative_top)