mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 04:09:33 -05:00
file(GENERATE): Refactor inputFileName calculation
This commit is contained in:
committed by
Brad King
parent
31b057182e
commit
a9602bb41e
@@ -125,12 +125,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
|
||||
if (this->InputIsContent) {
|
||||
inputContent = this->Input;
|
||||
} else {
|
||||
std::string inputFileName = this->Input;
|
||||
if (cmSystemTools::FileIsFullPath(inputFileName)) {
|
||||
inputFileName = cmSystemTools::CollapseFullPath(inputFileName);
|
||||
} else {
|
||||
inputFileName = this->FixRelativePath(inputFileName, PathForInput, lg);
|
||||
}
|
||||
const std::string inputFileName = this->GetInputFileName(lg);
|
||||
lg->GetMakefile()->AddCMakeDependFile(inputFileName);
|
||||
cmSystemTools::GetPermissions(inputFileName.c_str(), perm);
|
||||
cmsys::ifstream fin(inputFileName.c_str());
|
||||
@@ -174,6 +169,20 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
|
||||
}
|
||||
}
|
||||
|
||||
std::string cmGeneratorExpressionEvaluationFile::GetInputFileName(
|
||||
cmLocalGenerator* lg)
|
||||
{
|
||||
std::string inputFileName = this->Input;
|
||||
|
||||
if (cmSystemTools::FileIsFullPath(inputFileName)) {
|
||||
inputFileName = cmSystemTools::CollapseFullPath(inputFileName);
|
||||
} else {
|
||||
inputFileName = this->FixRelativePath(inputFileName, PathForInput, lg);
|
||||
}
|
||||
|
||||
return inputFileName;
|
||||
}
|
||||
|
||||
std::string cmGeneratorExpressionEvaluationFile::FixRelativePath(
|
||||
std::string const& relativePath, PathRole role, cmLocalGenerator* lg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user