summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-1/+2
| | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* cmMakefile: Simplify Add*Command and adopt to cmAddCustom*CommandNAKAMURA Takumi2021-11-181-10/+18
|
* cmMakefile: Move CMP0116 lookup into Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-8/+6
| | | | Avoid repeating it at every call site.
* cmCustomCommand: Record value of CMP0116 at time of creationKyle Edwards2021-02-231-6/+8
|
* Makefiles: Add support of DEPFILE for add_custom_commandMarc Chevrier2020-12-231-0/+6
| | | | | Issue: #20286 Fixes: #21415
* add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTSBrad King2020-12-111-8/+0
| | | | | | | | | Move rejection of `#`, `<`, and `>` characters in outputs and byproducts to a generate-time check. This removes the front-end check that disallowed generator expressions. The generators have already been updated to handle them. Fixes: #12877
* cmAddCustom{Command,Target}Command: Skip conversions on genex pathsBrad King2020-12-101-1/+3
| | | | | | | | | | | If an output or byproduct path starts in a generator expression, do not convert it to a full path yet. That will have to be done at generate time after evaluating the generator expressions. Also update the `add_custom_target` byproduct path conversion added by commit 445ff5ccdf (Byproducts: collapse full paths of custom target byproducts, 2019-09-11, v3.16.0-rc1~103^2~1) to match the behavior of `add_custom_command` when a path starts in a generator expression.
* cmAddCustomCommandCommand: Drop outdated commentBrad King2020-10-271-9/+1
|
* Remove unnecessary arbitrary CollapseFullPath second argumentsBrad King2020-10-271-2/+1
| | | | | | | | | | Some calls to CollapseFullPath that already have an absolute path were updated by commit 22f38c0d6b (cmake: avoid getcwd in `CollapseFullPath`, 2020-01-14, v3.17.0-rc1~171^2) to pass an arbitrary second argument to prevent unnecessary `getcwd` calls. Since then, the KWSys implementation of CollapseFullPath has learned to avoid unnecessary `getcwd` calls on its own, so we can drop the arbitrary second arguments to our CollapseFullPath calls.
* cmMakefile: Drop unnecessary custom command APPEND checkBrad King2020-10-081-10/+3
| | | | | | | Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. This includes the append-to-non-existing-command check, so we do not need it at configure time.
* Ninja Multi-Config: Add support for DEPFILE option in add_custom_command()Kyle Edwards2020-02-071-1/+1
| | | | And give other generators a path forward to add support in the future.
* cmake: avoid getcwd in `CollapseFullPath`Tim Blechmann2020-01-141-1/+2
| | | | | | `CollapseFullPath` calls getcwd, which is a rather expensive system call. we can replace it with `GetHomeOutputDirectory()` to save us from the calling overhead
* cmAddCustomCommandCommand: remove unnecessary bracesBen Boeckel2019-12-181-2/+2
|
* cmMakefile: Delay custom command creationDaniel Eiband2019-11-241-1/+1
| | | | | | | | Move custom command creation to cmLocalGenerator and dispatch custom commands in cmMakefile to generate time. Generators add custom commands using the new methods provided by cmLocalGenerator. Issue: #12877
* cmMakefile: Move enumerations into new headerDaniel Eiband2019-09-261-5/+5
| | | | The enumerations will also be used in cmLocalGenerator.
* add_custom_command: Format files in error message in a single lineDaniel Eiband2019-09-231-2/+2
|
* add_custom_target: Add output checks for custom target byproductsDaniel Eiband2019-09-231-32/+4
| | | | | Use the output checks for byproducts of add_custom_command also for byproducts of add_custom_target.
* add_custom_command: Add tests for custom command output checksDaniel Eiband2019-09-231-2/+2
|
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-8/+5
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* Merge topic 'prepare-deferred-custom-command-creation'Brad King2019-09-161-32/+8
|\ | | | | | | | | | | | | | | 5d28e361b7 add_custom_command: Move append functionality into class cmMakefile 4fb29850ad add_custom_command: Refactor setting implicit depends Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3810
| * add_custom_command: Move append functionality into class cmMakefileDaniel Eiband2019-09-131-9/+3
| |
| * add_custom_command: Refactor setting implicit dependsDaniel Eiband2019-09-121-23/+5
| | | | | | | | | | Implicit dependencies are now passed as argument to AddCustomCommandToOutput. This is necessary to be able to delay custom command creation.
* | add_custom_command: Delay slash conversion until after genex evaluationSebastian Lipponer2019-09-131-4/+3
|/ | | | | | Generator expressions may contain or produce backslashes. Fixes: #19553
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-2/+10
|
* cmA*Command: Turn into free functionsRegina Pfeifer2019-08-071-41/+43
| | | | Ref: #19499
* cmAddCustomCommand: Initialize static std::unordered_set on constructionSebastian Holtermann2019-06-041-24/+23
|
* Support job pools in custom commands and targetsRosen Matev2019-05-141-3/+16
| | | | | | | | | | 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
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-4/+4
| | | | Reduce the number of files relying on `cmake.h`.
* add_custom_{command,target}: Fix WORKING_DIRECTORY leading genexBrad King2018-11-031-6/+0
| | | | | | | | | | | 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
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-1/+1
|
* Merge topic 'std-string-apis'Brad King2018-02-011-2/+2
|\ | | | | | | | | | | | | 653b8946 Reduce raw string pointers usage. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1729
| * Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-3/+3
| | | | | | | | | | | | | | | | | | | | * 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.
* | cmAddCustomCommandCommand: use std::string const& for FileIsFullPathBen Boeckel2018-01-311-1/+1
| |
* | cmAddCustomCommandCommand: store keywords in stringsBen Boeckel2018-01-311-49/+99
|/ | | | | | | 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-4/+3
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-9/+6
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+1
|
* add_custom_{command,target}: Add COMMAND_EXPAND_LISTS optionEd Branch2017-01-141-2/+7
| | | | | | This option allows lists generated by generator expressions to be expanded. Closes: #15935
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-2/+10
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make the add_custom_command output more predictableStephen Kelly2016-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* add_custom_command: Add DEPFILE option for NinjaKulla Christoph2016-08-301-3/+16
| | | | | | | | Provide a way for custom commands to inform the ninja build tool about their implicit dependencies. For now simply make use of the option an error on other generators. Closes: #15479
* use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-238/+157
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Port to static cmPolicies API.Stephen Kelly2015-05-041-2/+1
|
* cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-2/+2
| | | | Match names used in CMake code.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-4/+4
| | | | All compilers hosting CMake support the std class.