1. 22 Apr, 2021 1 commit
  2. 11 Mar, 2021 2 commits
  3. 05 Mar, 2021 1 commit
    • Brad King's avatar
      ExternalData: Avoid replacing a concurrently-created object · fdfbf89f
      Brad King authored
      If more than one content link references the same object, the build
      system may launch multiple download processes for the same object
      concurrently.  Use whichever one finishes first, and discard the others.
      
      Without this, we replace the objects and use the last finisher instead
      of the first.  This is okay on non-Windows platforms where `rename(2)`
      gives reliable atomic replacement.  However, on Windows platforms and
      NTFS this is less reliable.  I've observed `MoveFileEx` somehow cause
      another process to get `ERROR_SHARING_VIOLATION` when attempting to read
      the destination file.  We may be able to improve the `file(RENAME)`
      implementation on modern Windows 10 versions, but for ExternalData's use
      case it is simpler to just not replace existing objects.
      fdfbf89f
  4. 02 Dec, 2020 1 commit
  5. 23 Oct, 2020 1 commit
  6. 07 Sep, 2020 1 commit
  7. 15 Feb, 2018 1 commit
  8. 17 May, 2017 1 commit
    • Daniel Pfeifer's avatar
      Use string(APPEND) in Modules · 9e24af01
      Daniel Pfeifer authored
      Automate with:
      
      find Modules -type f -print0 | xargs -0 perl -i -0pe \
        's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
      9e24af01
  9. 11 Nov, 2016 1 commit
  10. 18 Oct, 2016 1 commit
    • Matt McCormick's avatar
      ExternalData: Add support for multiple hash algorithms · 33a9aaa8
      Matt McCormick authored and Brad King's avatar Brad King committed
      Add support for projects to have `Data.txt.md5` *and* `Data.txt.sha512`
      where the content links hold hashes for the same file.  Check all
      `ExternalData_URL_TEMPLATES` entries in order for all available hashes.
      The data acquisition is considered a failure if none of the available
      URL resources has any of the given hashes.  This makes it possible to
      have multiple data server resources where all servers do not support all
      hashing algorithms.
      33a9aaa8
  11. 27 Sep, 2016 1 commit
    • Brad King's avatar
      Simplify CMake per-source license notices · 86578ecc
      Brad King authored
      Per-source copyright/license notice headers that spell out copyright holder
      names and years are hard to maintain and often out-of-date or plain wrong.
      Precise contributor information is already maintained automatically by the
      version control tool.  Ultimately it is the receiver of a file who is
      responsible for determining its licensing status, and per-source notices are
      merely a convenience.  Therefore it is simpler and more accurate for
      each source to have a generic notice of the license name and references to
      more detailed information on copyright holders and full license terms.
      
      Our `Copyright.txt` file now contains a list of Contributors whose names
      appeared source-level copyright notices.  It also references version control
      history for more precise information.  Therefore we no longer need to spell
      out the list of Contributors in each source file notice.
      
      Replace CMake per-source copyright/license notice headers with a short
      description of the license and lin...
      86578ecc
  12. 07 Sep, 2016 1 commit
    • Brad King's avatar
      ExternalData: Tolerate files duplicated across multiple targets · f9973166
      Brad King authored
      
      
      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's avatarDavid Manthey <david.manthey@kitware.com>
      f9973166
  13. 27 Jul, 2016 1 commit
    • Daniel Pfeifer's avatar
      Use string(APPEND) in Modules · 5d0d980d
      Daniel Pfeifer authored
      Automate with:
      
      find Modules -type f -print0 | xargs -0 perl -i -0pe \
      's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
      5d0d980d
  14. 13 Jul, 2016 1 commit
  15. 22 May, 2015 1 commit
  16. 27 Mar, 2015 2 commits
  17. 25 Feb, 2015 1 commit
    • Brad King's avatar
      ExternalData: Add support for custom algorithm-to-URL mapping · f7f4ca55
      Brad King authored
      Allow URL templates to contain a %(algo:<key>) placeholder that is
      replaced by mapping the canonical hash algorithm name through a map
      defined by the <key>.
      
      Extend the Module.ExternalData test to cover the behavior.
      Extend the RunCMake.ExternalData test to cover error cases.
      f7f4ca55
  18. 15 Jan, 2015 7 commits
  19. 05 Aug, 2014 1 commit
  20. 17 Apr, 2014 1 commit
    • Brad King's avatar
      ExternalData: Warn on missing file instead of failing · ccd29b9a
      Brad King authored
      When the primary source tree path named by a DATA{} reference does not
      exist, produce an AUTHOR_WARNING instead of a FATAL_ERROR.  This is
      useful when writing a new DATA{} reference to a test reference output
      that has not been created yet.  This way the developer can run the test,
      manually verify the output, and then copy it into place to provide the
      reference and eliminate the warning.
      
      If the named source tree path is expected to be a file but exists as a
      directory, we still need to produce a FATAL_ERROR.
      ccd29b9a
  21. 14 Apr, 2014 1 commit
  22. 13 Nov, 2013 1 commit
    • Brad King's avatar
      ExternalData: Allow local stores without any URL templates · 8eb20eea
      Brad King authored
      Allow ExternalData_URL_TEMPLATES to be empty if a value for
      ExternalData_OBJECT_STORES is provided.  Assume in this use case that
      the object stores will already contain all needed objects.  Extend the
      Module.ExternalData test to cover this case (all objects in stores).
      Extend the RunCMake.ExternalData test to cover the non-failure message
      case when stores are provided without URL templates.
      8eb20eea
  23. 12 Nov, 2013 2 commits
    • Brad King's avatar
      ExternalData: Show example network path URL template · f3883f36
      Brad King authored
      In the ExternalData_URL_TEMPLATES example, add an entry showing how to
      use the "file://" protocol with a network filesystem path.
      f3883f36
    • Brad King's avatar
      ExternalData: Format module documentation · ff6818bc
      Brad King authored
      Manually revise the .rst format of the documentation.  Use inline
      literal quotes appropriately in paragraph text.  Move the :: literal
      block openers to the end of the preceding paragraphs.  Convert the
      command signature documentation and examples to cmake code-block
      directives.
      ff6818bc
  24. 15 Oct, 2013 1 commit
  25. 02 Jun, 2013 1 commit
  26. 24 May, 2013 1 commit
    • Brad King's avatar
      ExternalData: Do not re-stage staged object files · c35961b0
      Brad King authored
      The ExternalData_LINK_CONTENT option tells ExternalData to convert real
      data files it finds into content links and to "stage" the original
      content in a ".ExternalData_<algo>_<hash>" file.  However, after a data
      object has been staged it is possible that a user-provided pattern in
      the "REGEX:" option will later match the staged object file.  We must
      not process staged object files even when a user pattern matches them.
      
      Fix the implementation to not match a staged object file as a normal
      data file for conversion.  Extend the RunCMake.ExternalData test to
      cover this case.
      c35961b0
  27. 12 Mar, 2013 1 commit
    • Brad King's avatar
      ExternalData: Preserve escaped semicolons during argument expansion · 1823ab4d
      Brad King authored
      
      
      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's avatarJean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
      1823ab4d
  28. 04 Feb, 2013 1 commit
    • Brad King's avatar
      ExternalData: Attach download rules to content links in IDEs · 1fd8d017
      Brad King authored
      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.
      1fd8d017
  29. 30 Jan, 2013 3 commits