mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Ninja: Support embedding of CMake as subninja project
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake generates a `build.ninja` file suitable for embedding into another ninja project potentially generated by an alien generator.
This commit is contained in:
committed by
Brad King
parent
038e7716e5
commit
8a862a4d4b
@@ -379,4 +379,19 @@ std::reverse_iterator<Iter> cmMakeReverseIterator(Iter it)
|
||||
return std::reverse_iterator<Iter>(it);
|
||||
}
|
||||
|
||||
inline bool cmHasSuffix(const std::string& str, const std::string& suffix)
|
||||
{
|
||||
if (str.size() < suffix.size()) {
|
||||
return false;
|
||||
}
|
||||
return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
|
||||
}
|
||||
|
||||
inline void cmStripSuffixIfExists(std::string& str, const std::string& suffix)
|
||||
{
|
||||
if (cmHasSuffix(str, suffix)) {
|
||||
str.resize(str.size() - suffix.size());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user