MCPcopy Create free account
hub / github.com/Kitware/CMake / StripExtension

Method StripExtension

Source/cmake.cxx:3277–3291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3275}
3276
3277std::string cmake::StripExtension(std::string const& file) const
3278{
3279 auto dotpos = file.rfind('.');
3280 if (dotpos != std::string::npos) {
3281#if defined(_WIN32) || defined(__APPLE__)
3282 auto ext = cmSystemTools::LowerCase(file.substr(dotpos + 1));
3283#else
3284 auto ext = cm::string_view(file).substr(dotpos + 1);
3285#endif
3286 if (this->IsAKnownExtension(ext)) {
3287 return file.substr(0, dotpos);
3288 }
3289 }
3290 return file;
3291}
3292
3293cmValue cmake::GetCacheDefinition(std::string const& name) const
3294{

Callers 2

GetSourceMethod · 0.80
CreateSourceMethod · 0.80

Calls 3

IsAKnownExtensionMethod · 0.95
rfindMethod · 0.80
substrMethod · 0.45

Tested by

no test coverage detected