mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
ExternalData: Collapse ../ components in DATA{} paths
Relative path components need to be normalized out even if they appear in the middle of a caller-supplied string.
This commit is contained in:
@@ -4,6 +4,7 @@ ExternalData_Add_Test(Data2
|
||||
NAME Data2Check
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D Data2=DATA{../Data2.dat}
|
||||
-D Data2b=DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data2b.dat}
|
||||
-D SeriesC=DATA{SeriesC_1_.my.dat,:}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/Data2Check.cmake
|
||||
)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
if(NOT EXISTS "${Data2}")
|
||||
message(SEND_ERROR "Input file:\n ${Data2}\ndoes not exist!")
|
||||
endif()
|
||||
foreach(d "${Data2}" "${Data2b}")
|
||||
file(STRINGS "${d}" lines LIMIT_INPUT 1024)
|
||||
if(NOT "x${lines}" STREQUAL "xInput file already transformed.")
|
||||
message(SEND_ERROR "Input file:\n ${d}\ndoes not have expected content, but [[${lines}]]")
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(n 1 2 3)
|
||||
string(REGEX REPLACE "_1_\\.my\\.dat$" "_${n}_.my.dat" SeriesCFile "${SeriesC}")
|
||||
if(NOT EXISTS "${SeriesCFile}")
|
||||
|
||||
1
Tests/Module/ExternalData/Data2b.dat.md5
Normal file
1
Tests/Module/ExternalData/Data2b.dat.md5
Normal file
@@ -0,0 +1 @@
|
||||
8c018830e3efa5caf3c7415028335a57
|
||||
Reference in New Issue
Block a user