mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-04 14:50:23 +00:00
Autogen: Add FindInIncludeDirectories method
This commit is contained in:
committed by
Brad King
parent
f379fdbb9e
commit
80a007534f
@@ -1626,6 +1626,25 @@ std::string cmQtAutoGenerators::FindMatchingHeader(
|
||||
return header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tries to find a file in the include directories
|
||||
* @return True on success
|
||||
*/
|
||||
bool cmQtAutoGenerators::FindInIncludeDirectories(
|
||||
std::string& file_n, const std::string& searchString) const
|
||||
{
|
||||
for (std::vector<std::string>::const_iterator iit =
|
||||
this->MocIncludePaths.begin();
|
||||
iit != this->MocIncludePaths.end(); ++iit) {
|
||||
const std::string fullPath = ((*iit) + '/' + searchString);
|
||||
if (cmsys::SystemTools::FileExists(fullPath.c_str())) {
|
||||
file_n = fullPath;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Generates the parent directory of the given file on demand
|
||||
* @return True on success
|
||||
|
||||
@@ -121,6 +121,8 @@ private:
|
||||
std::string FindMatchingHeader(const std::string& basePath,
|
||||
const std::string& baseName,
|
||||
const std::string& subDir) const;
|
||||
bool FindInIncludeDirectories(std::string& file_n,
|
||||
const std::string& searchString) const;
|
||||
|
||||
// - Target names
|
||||
std::string OriginTargetName;
|
||||
|
||||
Reference in New Issue
Block a user