| 92 | } |
| 93 | |
| 94 | bool TwoArgsSignature(std::vector<std::string> const& args, |
| 95 | cmExecutionStatus& status) |
| 96 | { |
| 97 | if (args.size() < 2) { |
| 98 | status.SetError("called with less than two arguments"); |
| 99 | return false; |
| 100 | } |
| 101 | |
| 102 | cmMakefile& mf = status.GetMakefile(); |
| 103 | |
| 104 | std::string const& define = args[0]; |
| 105 | cmValue cacheValue = mf.GetDefinition(define); |
| 106 | |
| 107 | std::string configType; |
| 108 | if (!cmSystemTools::GetEnv("CMAKE_CONFIG_TYPE", configType) || |
| 109 | configType.empty()) { |
| 110 | configType = "Release"; |
| 111 | } |
| 112 | |
| 113 | std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand( |
| 114 | "", configType, "", "", false); |
| 115 | |
| 116 | if (cacheValue) { |
| 117 | return true; |
| 118 | } |
| 119 | mf.AddCacheDefinition(define, makecommand, |
| 120 | "Command used to build entire project " |
| 121 | "from the command line.", |
| 122 | cmStateEnums::STRING); |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | } // namespace |
| 127 |
no test coverage detected
searching dependent graphs…