summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalData.cmake
Commit message (Collapse)AuthorAgeFilesLines
* ExternalData: Preserve escaped semicolons during argument expansionBrad King2013-03-121-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CMake language implicitly flattens lists so a ";" in a list element must be escaped with a backslash. List expansion removes backslashes escaping semicolons to leave raw semicolons in the values. Teach ExternalData_Add_Test and ExternalData_Expand_Arguments to re-escape semicolons found in list elements so the resulting argument lists work as if constructed directly by the set() command. For example: ExternalData_Add_Test(Data NAME test1 COMMAND ... "a\\;b") ExternalData_Expand_Arguments(Data args2 "c\\;d") add_test(NAME test2 COMMAND ... ${args2}) should be equivalent to set(args1 "a\\;b") add_test(NAME test1 COMMAND ... ${args1}) set(args2 "c\\;d") add_test(NAME test2 COMMAND ... ${args2}) which is equivalent to add_test(NAME test1 COMMAND ... "a;b") add_test(NAME test2 COMMAND ... "c;d") Note that it is not possible to make ExternalData_Add_Test act exactly like add_test when quoted arguments contain semicolons because the CMake language flattens lists when constructing function ARGN values. This re-escape approach at least allows test arguments to have semicolons. While at it, teach ExternalData APIs to not transform "DATA{...;...}" arguments because the contained semicolons are non-sensical. Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
* ExternalData: Attach download rules to content links in IDEsBrad King2013-02-041-2/+2
| | | | | | | Each data file to be created in the build tree corresponds one-to-one with a raw file or content link in the source tree. Use the MAIN_DEPENDENCY of add_custom_command to attach the build rule to the source tree file. This looks much nicer in the IDE project file browser and avoids ".rule" files.
* ExternalData: Collapse ../ components in DATA{} pathsBrad King2013-01-301-1/+2
| | | | | Relative path components need to be normalized out even if they appear in the middle of a caller-supplied string.
* ExternalData: Add support for SHA 1 and 2 hash algorithmsBrad King2013-01-301-2/+7
| | | | | Update the Module.ExternalData and RunCMake.ExternalData tests to cover some of them.
* ExternalData: Generalize hash algo/ext handlingBrad King2013-01-301-11/+9
| | | | | | | Use private global variables _ExternalData_REGEX_(ALGO|EXT) to match the possible hash algorithm names and extensions in regular expressions. Use "file(<algo>)" instead of "cmake -E md5sum" to compute hashes without a child process and to support more hash algorithms.
* ExternalData: Allow DATA{} syntax to reference directoriesBrad King2013-01-301-7/+38
| | | | | | | Use a trailing slash to reference a directory. Require that a list of associated files be specified to select from within the directory. One may simply use DATA{Dir/,REGEX:.*} to reference all files but get a directory passed on the command line.
* ExternalData: Allow ()-groups in series match regexBrad King2013-01-301-5/+8
| | | | | | | Refactor use of the ExternalData_SERIES_MATCH value to avoid assuming that it has no ()-groups that interfere with group indexing. Extend the Module.ExternalData test to cover this case.
* ExternalData: Improve series matching using an explicit syntaxBrad King2013-01-291-27/+55
| | | | | | | | | | | | | | Automatic series recognition can generate false positives too easily when the default series configuration is flexible enough to handle common cases. Avoid false positives by requiring an explicit syntax to activate series recognition. Choose the syntax DATA{<name>,:} to be short, simple, and look like a vertical ellipsis. This allows us to improve the default series match configuration. Allow series references to contain one of the numbered file names. Allow '-' as a separator in addition to '.' and '_'. Document what the default configuration matches. Also provide more options to configure series <name> parsing.
* ExternalData: Remove unused private interfaceBrad King2013-01-281-10/+0
| | | | | The 'store' action was part of an older design and is no longer needed. Remove it.
* ExternalData: Cleanup stray TODO and typo in commentsBrad King2013-01-281-2/+1
| | | | | Remove an outdated TODO line left from earlier designs. Also fix a typo.
* ExternalData: Do not match directory names when resolving DATA{}Brad King2013-01-281-2/+9
| | | | | | Our content link and object download infrastructure supports only blobs (files), not trees (directories). Do not allow references to end in a slash.
* ExternalData: Remove compatibility with CMake < 2.8.5Brad King2013-01-241-17/+6
| | | | | Now that the module comes in a sufficiently new CMake it does not need to support older versions.
* Add ExternalData moduleBrad King2013-01-241-0/+710
Take files we previously distributed in ITK 4.3.1: CMake/ExternalData.cmake CMake/ExternalData_config.cmake.in and add them for distribution in upstream CMake. Update the copyright notice block format to follow CMake conventions.