| 898 | } |
| 899 | |
| 900 | bool Project::cmake_minimum_version(int major, int minor) const { |
| 901 | // NOTE: this code is like pulling teeth, sorry |
| 902 | auto root_version = root()->cmake_version; |
| 903 | auto range_index = root_version.find("..."); |
| 904 | if (range_index != std::string::npos) { |
| 905 | root_version.resize(range_index); |
| 906 | } |
| 907 | |
| 908 | auto period_index = root_version.find('.'); |
| 909 | auto root_major = atoi(root_version.substr(0, period_index).c_str()); |
| 910 | int root_minor = 0; |
| 911 | if (period_index != std::string::npos) { |
| 912 | auto end_index = root_version.find('.', period_index + 1); |
| 913 | root_minor = atoi(root_version.substr(period_index + 1, end_index).c_str()); |
| 914 | } |
| 915 | |
| 916 | return std::tie(root_major, root_minor) >= std::tie(major, minor); |
| 917 | } |
| 918 | |
| 919 | bool Project::is_condition_name(const std::string &name) { |
| 920 | for (auto ch : name) { |
no outgoing calls
no test coverage detected