| 25 | #include "cmValue.h" |
| 26 | |
| 27 | bool cmAddCustomCommandCommand(std::vector<std::string> const& args, |
| 28 | cmExecutionStatus& status) |
| 29 | { |
| 30 | /* Let's complain at the end of this function about the lack of a particular |
| 31 | arg. For the moment, let's say that COMMAND, and either TARGET or SOURCE |
| 32 | are required. |
| 33 | */ |
| 34 | if (args.size() < 4) { |
| 35 | status.SetError("called with wrong number of arguments."); |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | cmMakefile& mf = status.GetMakefile(); |
| 40 | std::string source; |
| 41 | std::string target; |
| 42 | std::string main_dependency; |
| 43 | std::string working; |
| 44 | std::string depfile; |
| 45 | std::string job_pool; |
| 46 | std::string job_server_aware; |
| 47 | std::string comment_buffer; |
| 48 | char const* comment = nullptr; |
| 49 | std::vector<std::string> depends; |
| 50 | std::vector<std::string> outputs; |
| 51 | std::vector<std::string> output; |
| 52 | std::vector<std::string> byproducts; |
| 53 | bool verbatim = false; |
| 54 | bool append = false; |
| 55 | bool uses_terminal = false; |
| 56 | bool command_expand_lists = false; |
| 57 | bool depends_explicit_only = |
| 58 | mf.IsOn("CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY"); |
| 59 | bool codegen = false; |
| 60 | std::string implicit_depends_lang; |
| 61 | cmImplicitDependsList implicit_depends; |
| 62 | |
| 63 | // Accumulate one command line at a time. |
| 64 | cmCustomCommandLine currentLine; |
| 65 | |
| 66 | // Save all command lines. |
| 67 | cmCustomCommandLines commandLines; |
| 68 | |
| 69 | cmCustomCommandType cctype = cmCustomCommandType::POST_BUILD; |
| 70 | |
| 71 | enum tdoing |
| 72 | { |
| 73 | doing_source, |
| 74 | doing_command, |
| 75 | doing_target, |
| 76 | doing_depends, |
| 77 | doing_implicit_depends_lang, |
| 78 | doing_implicit_depends_file, |
| 79 | doing_main_dependency, |
| 80 | doing_output, |
| 81 | doing_outputs, |
| 82 | doing_byproducts, |
| 83 | doing_comment, |
| 84 | doing_working_directory, |
nothing calls this directly
no test coverage detected
searching dependent graphs…