ENH: ExternalData: Partly generalize hash algo/ext handling

Use private global variables _ExternalData_REGEX_(ALGO|EXT) to match the
possible hash algorithm names and extensions in regular expressions.
Note that we cannot yet use "file(<algo>)" instead of "cmake -E md5sum"
to compute hashes because it requires CMake >= 2.8.7.  Therefore we also
cannot yet allow other hash algorithms.  Leave a TODO comment.

Change-Id: I9e569432833fa9b754ba62b192179c783d4a6ebf
ENH: ExternalData: Attach download rules to content links in IDEs

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.

Change-Id: Id8c5043be9baad39701522a074b24bc6a48ce233
ENH: ExternalData: Preserve escaped semicolons during argument expansion

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.

Change-Id: I6ebd1e6a21a6621491343b0e85bf1502a3ae19f6
Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Merge topic 'ExternalData-updates'

5a11039 ENH: ExternalData: Preserve escaped semicolons during argument expansion
d42c3ab ENH: ExternalData: Attach download rules to content links in IDEs
48b7906 ENH: ExternalData: Partly generalize hash algo/ext handling