[Cmake-commits] CMake branch, master, updated. v3.9.0-rc2-45-g591557b

Kitware Robot kwrobot at kitware.com
Fri Jun 9 10:45:02 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  591557ba450f1f24610ea0eefcb4e1d7665fae25 (commit)
       via  c41a7c7d90e1fca52896dfeb99b7efd717aa6262 (commit)
      from  20df0bcd7026b9209fb8c88052ad637e2559c74f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=591557ba450f1f24610ea0eefcb4e1d7665fae25
commit 591557ba450f1f24610ea0eefcb4e1d7665fae25
Merge: 20df0bc c41a7c7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 9 14:36:23 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jun 9 10:36:30 2017 -0400

    Merge topic 'file-generate-path-cleanup'
    
    c41a7c7d file: Normalize GENERATE command input and output file paths
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !940


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c41a7c7d90e1fca52896dfeb99b7efd717aa6262
commit c41a7c7d90e1fca52896dfeb99b7efd717aa6262
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 8 09:54:37 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 8 10:41:28 2017 -0400

    file: Normalize GENERATE command input and output file paths
    
    Normalize absolute paths so that no extra components like `../` or
    `...//...` appear that later confuse relative path computation.
    In particular, we expect paths sent to AddCMakeDependFile and
    AddCMakeOutputFile to be normalized.
    
    Do this only for paths that are already absolute because
    we can't handle relative paths yet (see #16786).
    
    Fixes: #16892

diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 1526454..c21e4f6 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -51,11 +51,15 @@ void cmGeneratorExpressionEvaluationFile::Generate(
     }
   }
 
-  const std::string outputFileName = this->OutputFileExpr->Evaluate(
+  std::string outputFileName = this->OutputFileExpr->Evaluate(
     lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang);
   const std::string outputContent = inputExpression->Evaluate(
     lg, config, false, CM_NULLPTR, CM_NULLPTR, CM_NULLPTR, lang);
 
+  if (cmSystemTools::FileIsFullPath(outputFileName)) {
+    outputFileName = cmSystemTools::CollapseFullPath(outputFileName);
+  }
+
   std::map<std::string, std::string>::iterator it =
     outputFiles.find(outputFileName);
 
@@ -111,12 +115,16 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
   if (this->InputIsContent) {
     inputContent = this->Input;
   } else {
-    lg->GetMakefile()->AddCMakeDependFile(this->Input);
-    cmSystemTools::GetPermissions(this->Input.c_str(), perm);
-    cmsys::ifstream fin(this->Input.c_str());
+    std::string inputFileName = this->Input;
+    if (cmSystemTools::FileIsFullPath(inputFileName)) {
+      inputFileName = cmSystemTools::CollapseFullPath(inputFileName);
+    }
+    lg->GetMakefile()->AddCMakeDependFile(inputFileName);
+    cmSystemTools::GetPermissions(inputFileName.c_str(), perm);
+    cmsys::ifstream fin(inputFileName.c_str());
     if (!fin) {
       std::ostringstream e;
-      e << "Evaluation file \"" << this->Input << "\" cannot be read.";
+      e << "Evaluation file \"" << inputFileName << "\" cannot be read.";
       lg->IssueMessage(cmake::FATAL_ERROR, e.str());
       return;
     }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorExpressionEvaluationFile.cxx |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list