ExternalData: Add option to recursively match under directories

Extend the ``DATA{Dir/,...}`` syntax with a new ``RECURSE:`` option
to enable recursive matching of associated files.  This will allow
an entire directory tree of data to be referenced at once.
This commit is contained in:
Brad King
2015-03-25 10:23:51 -04:00
parent 564c07f7dd
commit 230f2d6e70
23 changed files with 76 additions and 3 deletions
+1
View File
@@ -44,6 +44,7 @@ ExternalData_Add_Test(Data1
-D Paired=DATA{PairedA.dat,PairedB.dat}
-D Meta=DATA{MetaTop.dat,REGEX:Meta[ABC].dat}
-D Directory=DATA{Directory/,A.dat,REGEX:[BC].dat}
-D DirRecurse=DATA{DirRecurse/,RECURSE:,A.dat,REGEX:[BC].dat}
-D "Semicolons=DATA{Data.dat}\\;DATA{Data.dat}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/Data1Check.cmake
)
@@ -90,6 +90,12 @@ foreach(n A B C)
message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!")
endif()
endforeach()
foreach(n A Sub1/A Sub2/Dir/A B Sub1/B Sub2/Dir/B C Sub1/C Sub2/Dir/C)
set(file "${DirRecurse}/${n}.dat")
if(NOT EXISTS "${file}")
message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!")
endif()
endforeach()
list(LENGTH Semicolons len)
if("${len}" EQUAL 2)
foreach(file ${Semicolons})
@@ -0,0 +1 @@
9d980b06c2f0fec3d4872d68175b9822
@@ -0,0 +1 @@
8f4add4581551facf27237e6577fd662
@@ -0,0 +1 @@
c1030719c95f3435d8abc39c0d442946
@@ -0,0 +1 @@
9d980b06c2f0fec3d4872d68175b9822
@@ -0,0 +1 @@
8f4add4581551facf27237e6577fd662
@@ -0,0 +1 @@
c1030719c95f3435d8abc39c0d442946
@@ -0,0 +1 @@
9d980b06c2f0fec3d4872d68175b9822
@@ -0,0 +1 @@
8f4add4581551facf27237e6577fd662
@@ -0,0 +1 @@
c1030719c95f3435d8abc39c0d442946