summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalData
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-30 19:44:49 (GMT)
committerBrad King <brad.king@kitware.com>2013-01-30 19:55:12 (GMT)
commite2e0d2e3c7108d5ce41f032ad9089155c6b4735c (patch)
tree35f65eec3eb7fa5c739f19cee30a44f94e1decb1 /Tests/RunCMake/ExternalData
parentee2abfdc8913e4e9a5bc77c56a9d3dea83fde6f1 (diff)
downloadCMake-e2e0d2e3c7108d5ce41f032ad9089155c6b4735c.zip
CMake-e2e0d2e3c7108d5ce41f032ad9089155c6b4735c.tar.gz
CMake-e2e0d2e3c7108d5ce41f032ad9089155c6b4735c.tar.bz2
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.
Diffstat (limited to 'Tests/RunCMake/ExternalData')
-rw-r--r--Tests/RunCMake/ExternalData/SubDirectory1-stdout.txt3
-rw-r--r--Tests/RunCMake/ExternalData/SubDirectory1/CMakeLists.txt12
2 files changed, 13 insertions, 2 deletions
diff --git a/Tests/RunCMake/ExternalData/SubDirectory1-stdout.txt b/Tests/RunCMake/ExternalData/SubDirectory1-stdout.txt
index 35a8cc1..03924cb 100644
--- a/Tests/RunCMake/ExternalData/SubDirectory1-stdout.txt
+++ b/Tests/RunCMake/ExternalData/SubDirectory1-stdout.txt
@@ -1,2 +1,3 @@
--- Data reference correctly transformed in parent dir!
+-- Data reference correctly transformed in parent dir 1!
+-- Data reference correctly transformed in parent dir 2!
-- Data reference correctly transformed in current dir!
diff --git a/Tests/RunCMake/ExternalData/SubDirectory1/CMakeLists.txt b/Tests/RunCMake/ExternalData/SubDirectory1/CMakeLists.txt
index 0782460..881ff5c 100644
--- a/Tests/RunCMake/ExternalData/SubDirectory1/CMakeLists.txt
+++ b/Tests/RunCMake/ExternalData/SubDirectory1/CMakeLists.txt
@@ -2,7 +2,17 @@ set(input ../Data.txt)
set(output ${CMAKE_BINARY_DIR}/Data.txt)
ExternalData_Expand_Arguments(Data args DATA{${input}})
if("x${args}" STREQUAL "x${output}")
- message(STATUS "Data reference correctly transformed in parent dir!")
+ message(STATUS "Data reference correctly transformed in parent dir 1!")
+else()
+ message(FATAL_ERROR "Data reference transformed to:\n ${args}\n"
+ "but we expected:\n ${output}")
+endif()
+
+set(input ${CMAKE_CURRENT_SOURCE_DIR}/../Data.txt)
+set(output ${CMAKE_BINARY_DIR}/Data.txt)
+ExternalData_Expand_Arguments(Data args DATA{${input}})
+if("x${args}" STREQUAL "x${output}")
+ message(STATUS "Data reference correctly transformed in parent dir 2!")
else()
message(FATAL_ERROR "Data reference transformed to:\n ${args}\n"
"but we expected:\n ${output}")