diff options
author | Josef Angstenberger <code@jtxa.de> | 2020-08-01 00:58:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-19 13:03:36 (GMT) |
commit | a9602bb41e562ae48332e5fd54577868e9d23e06 (patch) | |
tree | ab7f44aceb3749828eab1fefaf283dccf24bd78d /Source/cmGeneratorExpressionEvaluationFile.cxx | |
parent | 31b057182e75130dc3fb77f0bf1fe0d0abb1a60c (diff) | |
download | CMake-a9602bb41e562ae48332e5fd54577868e9d23e06.zip CMake-a9602bb41e562ae48332e5fd54577868e9d23e06.tar.gz CMake-a9602bb41e562ae48332e5fd54577868e9d23e06.tar.bz2 |
file(GENERATE): Refactor inputFileName calculation
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluationFile.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluationFile.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 1107adb..e421c51 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -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) { |