| 883 | } |
| 884 | |
| 885 | bool HandleHashCommand(std::vector<std::string> const& args, |
| 886 | cmExecutionStatus& status) |
| 887 | { |
| 888 | if (args.size() != 3) { |
| 889 | status.SetError("HASH must be called with two arguments."); |
| 890 | return false; |
| 891 | } |
| 892 | |
| 893 | std::string inputPath; |
| 894 | if (!getInputPath(args[1], status, inputPath)) { |
| 895 | return false; |
| 896 | } |
| 897 | |
| 898 | auto const& output = args[2]; |
| 899 | |
| 900 | if (output.empty()) { |
| 901 | status.SetError("Invalid name for output variable."); |
| 902 | return false; |
| 903 | } |
| 904 | |
| 905 | auto hash = hash_value(cmCMakePath(inputPath).Normal()); |
| 906 | |
| 907 | std::ostringstream out; |
| 908 | out << std::setbase(16) << hash; |
| 909 | |
| 910 | status.GetMakefile().AddDefinition(output, out.str()); |
| 911 | |
| 912 | return true; |
| 913 | } |
| 914 | } // anonymous namespace |
| 915 | |
| 916 | bool cmCMakePathCommand(std::vector<std::string> const& args, |
nothing calls this directly
no test coverage detected
searching dependent graphs…