diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2013-06-03 17:42:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-03 17:43:52 (GMT) |
commit | e4e09212c58995a6cfde7d101bc02fce0f7829be (patch) | |
tree | 219aa9a80e2c182d3be38d3cccf8f3809c585720 /Tests/RunCMake/ExternalData/LinkDirectory1.cmake | |
parent | c9b75dcd734e2dd09eadbd9b16a6497bae95941c (diff) | |
parent | a4d8c64d10105fd4448ffde6a5d2fb74c1bb4f57 (diff) | |
download | CMake-e4e09212c58995a6cfde7d101bc02fce0f7829be.zip CMake-e4e09212c58995a6cfde7d101bc02fce0f7829be.tar.gz CMake-e4e09212c58995a6cfde7d101bc02fce0f7829be.tar.bz2 |
Merge branch 'master' into escape-regex-specials-in-path
Resolve conflicts in Tests/CTestTestMemcheck/CMakeLists.txt by combining
changes from both sides.
Diffstat (limited to 'Tests/RunCMake/ExternalData/LinkDirectory1.cmake')
-rw-r--r-- | Tests/RunCMake/ExternalData/LinkDirectory1.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalData/LinkDirectory1.cmake b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake new file mode 100644 index 0000000..541fc79 --- /dev/null +++ b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake @@ -0,0 +1,37 @@ +include(ExternalData) +set(ExternalData_LINK_CONTENT MD5) +set(ExternalData_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set(ExternalData_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/ExternalData) +set(input ${CMAKE_CURRENT_BINARY_DIR}/Dir) +set(output ${CMAKE_CURRENT_BINARY_DIR}/ExternalData/Dir) +set(staged "${input}/.ExternalData_MD5_c18ff9804c8deec9eaeb17063cda8b7b") +set(content "To be transformed into a content link.") +file(REMOVE ${staged}) +file(REMOVE_RECURSE ${input}) +file(WRITE ${input}/ToLink.txt "${content}") +ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}") +if("x${args}" STREQUAL "x${output}") + message(STATUS "Raw data correctly transformed to content link!") +else() + message(FATAL_ERROR "Data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() +if(EXISTS "${staged}") + message(STATUS "Staged content exists!") +else() + message(FATAL_ERROR "Staged content missing!") +endif() + +# Expand again to check whether staged content is ignored. +ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}") +file(STRINGS "${staged}" staged_content LIMIT_INPUT 1024) +if("${content}" STREQUAL "${staged_content}") + message(STATUS "Staged content is correct!") +else() + message(STATUS "Staged content is incorrect!") +endif() +if(EXISTS "${staged}.md5") + message(FATAL_ERROR "Staged content was incorrectly re-staged!") +else() + message(STATUS "Staged content was correctly not re-staged!") +endif() |