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 2013-02-03 11:04:57 -05:00
parent 06e8dedb3c
commit aed590a7e0

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