1. 04 Jun, 2019 1 commit
  2. 14 May, 2019 1 commit
    • Rosen Matev's avatar
      Support job pools in custom commands and targets · 9f76961d
      Rosen Matev authored
      Provide a way for custom commands and targets to set the pool variable
      of the ninja build statement. Setting `JOB_POOL` is not compatible with
      `USES_TERMINAL`, which implies the `console` pool.
      
      The option is silently ignored with other generators.
      
      Closes: #18483
      9f76961d
  3. 16 Jan, 2019 1 commit
  4. 03 Nov, 2018 1 commit
    • Brad King's avatar
      add_custom_{command,target}: Fix WORKING_DIRECTORY leading genex · 98d59417
      Brad King authored
      Since commit v3.13.0-rc1~39^2 (add_custom_{command,target}:
      WORKING_DIRECTORY generator expressions, 2018-09-22) the
      `WORKING_DIRECTORY` option accepts generator expressions.
      Fix support for the case of a leading generator expression
      by deferring conversion to an absolute path until after
      evaluation of the generator expression.
      
      Fixes: #18543
      98d59417
  5. 27 Aug, 2018 1 commit
  6. 31 Jan, 2018 3 commits
    • Ben Boeckel's avatar
    • Ben Boeckel's avatar
      cmAddCustomCommandCommand: store keywords in strings · c0e7a137
      Ben Boeckel authored
      Callgrind indicated that `strlen` was being called a lot of times here
      due to the string comparisons. Since keywords are "sparse" in
      `add_custom_command`, use a hash comparison to handle keywords and then
      use strings for comparison since they have a built-in length parameter.
      c0e7a137
    • Pavel Solodovnikov's avatar
      Reduce raw string pointers usage. · 653b8946
      Pavel Solodovnikov authored
      * Change some functions to take `std::string` instead of
        `const char*` in the following classes: `cmMakeFile`, `cmake`,
        `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
        and a few others.
      * Greatly reduce using of `const char*` overloads for
        `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
      * Remove many redundant `c_str()` conversions throughout the code.
      653b8946
  7. 26 Jan, 2018 1 commit
  8. 12 Sep, 2017 1 commit
  9. 24 Aug, 2017 1 commit
  10. 01 Jun, 2017 1 commit
  11. 13 Jan, 2017 1 commit
  12. 26 Oct, 2016 1 commit
  13. 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 links to `Copyright.txt` and online information
      available from "https://cmake.org/licensing".  The online URL also handles
      cases of modules being copied out of our source into other projects, so we
      can drop our notices about replacing links with full license text.
      
      Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
      of the replacements mechanically.  Manually fix up shebang lines and trailing
      newlines in a few files.  Manually update the notices in a few files that the
      script does not handle.
      86578ecc
  14. 19 Sep, 2016 1 commit
    • Stephen Kelly's avatar
      Make the add_custom_command output more predictable · 92d76b50
      Stephen Kelly authored
      I otherwise get:
      
         Expected stderr to match:
      
          expect-err> CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
          expect-err>   add_custom_command given APPEND option with output.*
          expect-err>   which is not already a custom command output.
          expect-err> Call Stack \(most recent call first\):
          expect-err>   CMakeLists.txt:3 \(include\)
      
         Actual stderr:
      
          actual-err> CMake Error at AppendNotOutput.cmake:1 (add_custom_command):
          actual-err>   add_custom_command given APPEND option with output
          actual-err>   "/home/stephen/dev/src/cmake/with
          actual-err> space/Tests/RunCMake/add_custom_command/AppendNotOutput-build/out" which is
          actual-err>   not already a custom command output.
          actual-err> Call Stack (most recent call first):
          actual-err>   CMakeLists.txt:3 (include)
      
      Using a specific line for paths is a style already used elsewhere for
      the same reason, such as CMP0041 output.
      92d76b50
  15. 30 Aug, 2016 1 commit
  16. 28 Jun, 2016 1 commit
  17. 16 May, 2016 1 commit
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format · d9fd2f54
      Kitware Robot authored
      Run the `Utilities/Scripts/clang-format.bash` script to update
      all our C++ code to a new style defined by `.clang-format`.
      Use `clang-format` version 3.8.
      
      * If you reached this commit for a line in `git blame`, re-run the blame
        operation starting at the parent of this commit to see older history
        for the content.
      
      * See the parent commit for instructions to rebase a change across this
        style transition commit.
      d9fd2f54
  18. 09 May, 2016 1 commit
    • Brad King's avatar
      Remove `//------...` horizontal separator comments · 0ac18d40
      Brad King authored
      Modern editors provide plenty of ways to visually separate functions.
      Drop the explicit comments that previously served this purpose.
      Use the following command to automate the change:
      
          $ git ls-files -z -- \
              "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
            egrep -z -v "^Source/cmCommandArgumentLexer\." |
            egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmDependsJavaLexer\." |
            egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmExprLexer\." |
            egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmFortranLexer\." |
            egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmListFileLexer\." |
            egrep -z -v "^Source/cm_sha2" |
            egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
            egrep -z -v "^Utilities/(KW|cm).*/" |
            xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'
      
      This avoids modifying third-party sources and generated sources.
      0ac18d40
  19. 04 May, 2015 1 commit
  20. 20 Apr, 2015 1 commit
  21. 11 Jan, 2015 1 commit
  22. 14 Nov, 2014 2 commits
    • Brad King's avatar
      Add an option for explicit BYPRODUCTS of custom commands (#14963) · e15a7075
      Brad King authored
      A common idiom in CMake-based build systems is to have custom commands
      that generate files not listed explicitly as outputs so that these
      files do not have to be newer than the inputs.  The file modification
      times of such "byproducts" are updated only when their content changes.
      Then other build rules can depend on the byproducts explicitly so that
      their dependents rebuild when the content of the original byproducts
      really does change.
      
      This "undeclared byproduct" approach is necessary for Makefile, VS, and
      Xcode build tools because if a byproduct were listed as an output of a
      rule then the rule would always rerun when the input is newer than the
      byproduct but the byproduct may never be updated.
      
      Ninja solves this problem by offering a 'restat' feature to check
      whether an output was really modified after running a rule and tracking
      the fact that it is up to date separately from its timestamp.  However,
      Ninja also stats all dependencies up front and will only restat files
      that are listed as outputs of rules with the 'restat' option enabled.
      Therefore an undeclared byproduct that does not exist at the start of
      the build will be considered missing and the build will fail even if
      other dependencies would cause the byproduct to be available before its
      dependents build.
      
      CMake works around this limitation by adding 'phony' build rules for
      custom command dependencies in the build tree that do not have any
      explicit specification of what produces them.  This is not optimal
      because it prevents Ninja from reporting an error when an input to a
      rule really is missing.  A better approach is to allow projects to
      explicitly specify the byproducts of their custom commands so that no
      phony rules are needed for them.  In order to work with the non-Ninja
      generators, the byproducts must be known separately from the outputs.
      
      Add a new "BYPRODUCTS" option to the add_custom_command and
      add_custom_target commands to specify byproducts explicitly.  Teach the
      Ninja generator to specify byproducts as outputs of the custom commands.
      In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets
      that link, the byproducts must be specified as outputs of the link rule
      that runs the commands.  Activate 'restat' for such rules so that Ninja
      knows it needs to check the byproducts, but not for link rules that have
      no byproducts.
      e15a7075
    • Peter Collingbourne's avatar
      Add USES_TERMINAL option for custom commands · fe5d6e8c
      Peter Collingbourne authored
      Teach the add_custom_command and add_custom_target commands a new
      USES_TERMINAL option.  Use it to tell the generator to give the command
      direct access to the terminal if possible.
      fe5d6e8c
  23. 15 Oct, 2014 1 commit
  24. 28 May, 2014 1 commit
    • Stephen Kelly's avatar
      add_custom_command: Normalize OUTPUT and DEPENDS paths. · c4af46b4
      Stephen Kelly authored
      While tracing dependencies of a target, cmTargetTraceDependencies
      follows sources by full path to determine if the source is to be
      produced by a custom command.  Commit 4959f341 (cmSourceFileLocation:
      Collapse full path for directory comparisons., 2014-03-27) changed
      the storage of target sources to be in the form of a normalized
      path instead of an unnormalized path.
      
      The path is followed by looking it up in a mapping via
      cmMakefile::GetSourceFileWithOutput to acquire an appropriate
      cmSourceFile.  The mapping is populated with the OUTPUT components
      of add_custom_command invocations, however it is populated with
      unnormalized paths.  This means that the tracing logic does not
      find appropriate cmSourceFiles, and does not generate appropriate
      build rules for the generated sources.
      
      Normalize the paths in the OUTPUT components of add_custom_command
      to resolve this.
      
      The paths in the DEPENDS component of add_custom_command are also
      not normalized, leading to the same problem again.  Normalize the
      depends paths after generator evaluation and expansion.
      c4af46b4
  25. 11 Mar, 2014 2 commits
  26. 12 Feb, 2014 1 commit
  27. 30 Mar, 2011 1 commit
    • Brad King's avatar
      Normalize slashes of add_custom_(command|target) DEPENDS (#11973) · 12860505
      Brad King authored
      All commands accepting file paths should normalize the slashes so that
      the string-represented names can be compared reliably.  The commands
      add_library and add_executable have done this for years.  We taught
      add_custom_command to normalize its OUTPUT names in commit a75a0a14
      (Normalize add_custom_command OUTPUT names, 2010-12-15).  We handled a
      special case of the DEPENDS option in commit 7befc007 (Handle trailing
      slashes on add_custom_command DEPENDS, 2011-01-26).
      
      Teach both add_custom_command and add_custom_target to normalize slashes
      of DEPENDS files up front.  This approach subsumes the above-mentioned
      special case so remove the one line added for it but keep its test.
      Extend the CustomCommand test to check that slash count mismatches
      between custom command OUTPUT and DEPENDS can still be linked correctly.
      12860505
  28. 26 Jan, 2011 1 commit
  29. 15 Dec, 2010 1 commit
    • Brad King's avatar
      Normalize add_custom_command OUTPUT names (#10485) · a75a0a14
      Brad King authored
      Previously the OUTPUT arguments of add_custom_command were not
      slash-normalized but those of add_library and add_executable were.
      This caused the example
      
        add_custom_command(OUTPUT a//b.c ...)
        add_library(... a//b.c ...)
      
      to fail at build time with "no rule to make a/b.c".  Fix this and modify
      the CustomCommand test to try it.
      a75a0a14
  30. 01 Oct, 2009 1 commit
  31. 28 Sep, 2009 1 commit
    • Brad King's avatar
      Convert CMake to OSI-approved BSD License · 96afb120
      Brad King authored
      This converts the CMake license to a pure 3-clause OSI-approved BSD
      License.  We drop the previous license clause requiring modified
      versions to be plainly marked.  We also update the CMake copyright to
      cover the full development time range.
      96afb120
  32. 02 Jun, 2008 1 commit
  33. 14 May, 2008 1 commit
  34. 30 Jan, 2008 1 commit
  35. 23 Jan, 2008 1 commit
  36. 17 Sep, 2007 1 commit