summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)Craig Scott2024-11-151-0/+1
| | | | Fixes: #26449
* add_custom_command: Validate arguments more rigorouslyCraig Scott2024-09-091-0/+203
| | | | | | | Add a new CMP0175 policy to preserve backward compatibility for projects that were using unsupported keywords or arguments. Fixes: #26096, #21089, #18976
* add_custom_command: Add CODEGEN supportJuan Ramos2024-07-011-1/+29
| | | | | | | | | | | By specifying CODEGEN as an argument to add_custom_command the custom command will be added to a codegen build target. The intent is to provide a convenient way for users to get their generated files without having to build the whole project. This can be helpful for code analysis tools which can be useful for IDEs and CI.
* cmAddCustomCommandCommand: Move SOURCE signature error messagesJuan Ramos2024-05-161-6/+11
| | | | | Helps readability of the code. All the SOURCE signature code is in the else statement.
* cmAddCustomCommandCommand: use `cmStrCat`Ben Boeckel2023-11-011-2/+2
|
* add_custom_{command,target}: Teach JOB_SERVER_AWARE about WORKING_DIRECTORYChris Mahoney2023-07-251-9/+1
| | | | Issue: #16273
* add_custom_{target,command}: Add argument JOB_SERVER_AWAREChris Mahoney2023-07-191-0/+19
| | | | Issue: #16273
* Add variable CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLYAbdelmaged Khalifa2023-02-171-1/+2
| | | | | | | Add CMake variable `CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY` to enable option `DEPENDS_EXPLICIT_ONLY` on all uses of `add_custom_command`. Fixes: #17097
* add_custom_command: Add DEPENDS_EXPLICIT_ONLY option for NinjaAbdelmaged Khalifa2023-02-141-1/+7
| | | | | | | | | Add option `DEPENDS_EXPLICIT_ONLY` to `add_custom_command` to indicate that implicit dependencies coming from users of the output are not needed, and only consider dependencies explicitly specified in the custom command. Fixes: #17097
* 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
|