Fix Module.ExternalData test on Cygwin

In ExternalData_URL_TEMPLATES add a leading slash to the path after
file:// only if the path does not already start with one.
This commit is contained in:
Brad King committed 2013-02-04 15:19:49 -05:00
1 parent 06e8dedb3c
commit aed590a7e0
1 file changed
+5 -1
+5 -1
View File
@@ -4,8 +4,12 @@ project(ExternalDataTest NONE)
include(CTest)
include(ExternalData)
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/")
set(slash /)
endif()
set(ExternalData_URL_TEMPLATES
"file:///${CMAKE_CURRENT_SOURCE_DIR}/%(algo)/%(hash)"
"file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/%(algo)/%(hash)"
)
set(ExternalData_BINARY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ExternalData")
file(REMOVE_RECURSE ${ExternalData_BINARY_ROOT}) # clean test