CMake/Tests/Module/ExternalData
Brad King f9973166e8 ExternalData: Tolerate files duplicated across multiple targets
If multiple ExternalData_Target_Add calls generate the same output file
then we need to avoid calling add_custom_command multiple times with
that output.  This was already done within a single target by setting a
variable in the local function scope.  This will not be visible in other
calls though so we need to use a directory property instead to prevent
adding a custom command multiple times for one output in a directory.

Normally it is not safe to have multiple custom commands that produce
the same output file across multiple independent targets, but since we
use atomic replacement of outputs the resulting races should not be a
problem.  For the convenience of projects, tolerate this instead of
diagnosing it.  In particular, we previously allowed up to two copies
of the custom command in one directory because CMake has a fallback
from MAIN_DEPENDENCY to an `<output>.rule` file.

While at it, add a note to the documentation that typically only one
external data target should be needed for a project.

Reported-by: David Manthey <david.manthey@kitware.com>
2016-09-07 15:17:33 -04:00
..
Alt ExternalData: Add support for custom algorithm-to-URL mapping 2015-02-25 08:28:05 -05:00
Data2 ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
Data3
Data4 ExternalData: Allow local stores without any URL templates 2013-11-13 10:03:36 -05:00
Data5 ExternalData: Tolerate files duplicated across multiple targets 2016-09-07 15:17:33 -04:00
DataNoSymlinks ExternalData: Add option to disable use of symlinks 2015-05-22 09:21:47 -04:00
DirRecurse ExternalData: Add option to recursively match under directories 2015-03-27 14:44:54 -04:00
Directory ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
MD5 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA1 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA224 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA256 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
CMakeLists.txt ExternalData: Tolerate files duplicated across multiple targets 2016-09-07 15:17:33 -04:00
Data Space.dat.md5 ExternalData: Test content link with a space in its name 2013-02-22 08:25:06 -05:00
Data.dat.md5
Data1Check.cmake ExternalData: Add option to recursively match under directories 2015-03-27 14:44:54 -04:00
Data2.dat.md5
Data2b.dat.md5 ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
DataAlgoMapA.dat.md5 ExternalData: Add support for custom algorithm-to-URL mapping 2015-02-25 08:28:05 -05:00
DataAlgoMapB.dat.sha1 ExternalData: Add support for custom algorithm-to-URL mapping 2015-02-25 08:28:05 -05:00
DataScript.dat.md5 ExternalData: Add support for custom download scripts 2015-01-15 10:48:09 -05:00
MetaA.dat.md5
MetaB.dat.md5
MetaC.dat.md5
MetaTop.dat.md5
MyScript1.cmake ExternalData: Add support for custom download scripts 2015-01-15 10:48:09 -05:00
PairedA.dat.md5
PairedB.dat.md5
SeriesA.dat.md5
SeriesA1.dat.md5
SeriesA2.dat.md5
SeriesA3.dat.md5
SeriesAn1.dat.md5
SeriesAn2.dat.md5
SeriesAn3.dat.md5
SeriesB.dat.md5
SeriesB_1.dat.md5
SeriesB_2.dat.md5
SeriesB_3.dat.md5
SeriesBn_1.dat.md5
SeriesBn_2.dat.md5
SeriesBn_3.dat.md5
SeriesC.1.dat.md5
SeriesC.2.dat.md5
SeriesC.3.dat.md5
SeriesC.dat.md5
SeriesCn.1.dat.md5
SeriesCn.2.dat.md5
SeriesCn.3.dat.md5
SeriesD-1.dat.md5
SeriesD-2.dat.md5
SeriesD-3.dat.md5
SeriesD.dat.md5
SeriesDn-1.dat.md5
SeriesDn-2.dat.md5
SeriesDn-3.dat.md5
SeriesMixed.1.dat.md5 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.2.dat.sha1 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.3.dat.sha224 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.4.dat.sha256 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00