[Cmake-commits] CMake branch, master, updated. v3.11.0-rc4-336-g99f3f6d

Kitware Robot kwrobot at kitware.com
Tue Mar 27 07:55:14 EDT 2018


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  99f3f6d528fb9e7e05c1618675d4c998fce3dd59 (commit)
       via  df0cfdf60e9f090c1050e55643349fbb052a52c0 (commit)
       via  b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1 (commit)
       via  a0d9429bd70426b6444d3987d7023fe40e203b88 (commit)
       via  70c50aa23cc993a502cd3c87be8afb79d973b50e (commit)
       via  85468e0754fb984aa5d042d07f8e52b67e969741 (commit)
      from  82b0316e0a4e5e724770574ae374a9b3df11bccc (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=99f3f6d528fb9e7e05c1618675d4c998fce3dd59
commit 99f3f6d528fb9e7e05c1618675d4c998fce3dd59
Merge: df0cfdf 85468e0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 27 11:49:27 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Mar 27 07:51:34 2018 -0400

    Merge topic 'const-members'
    
    85468e0754 cmComputeLinkInformation: make some members const
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1886


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df0cfdf60e9f090c1050e55643349fbb052a52c0
commit df0cfdf60e9f090c1050e55643349fbb052a52c0
Merge: b9788dc a0d9429
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 27 11:49:05 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Mar 27 07:50:55 2018 -0400

    Merge topic 'vs-options-movexml'
    
    a0d9429bd7 cmVisualStudioGeneratorOptions: Move XML code to subclasses
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1885


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1
commit b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1
Merge: 82b0316 70c50aa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 27 11:48:39 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Mar 27 07:49:28 2018 -0400

    Merge topic 'revert-CTestTestfile-removal-again'
    
    70c50aa23c Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1887


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0d9429bd70426b6444d3987d7023fe40e203b88
commit a0d9429bd70426b6444d3987d7023fe40e203b88
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Thu Mar 22 10:15:36 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 26 09:35:58 2018 -0400

    cmVisualStudioGeneratorOptions: Move XML code to subclasses

diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 500a0aa..c7bb38c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2065,6 +2065,15 @@ std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle(
   return ret;
 }
 
+void cmVS7GeneratorOptions::OutputFlag(std::ostream& fout, const char* indent,
+                                       const char* tag,
+                                       const std::string& content)
+{
+  fout << indent << tag << "=\"";
+  fout << cmLocalVisualStudio7GeneratorEscapeForXML(content);
+  fout << "\"";
+}
+
 // This class is used to parse an existing vs 7 project
 // and extract the GUID
 class cmVS7XMLParser : public cmXMLParser
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 02e6931..22b4264 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -21,6 +21,19 @@ class cmMakefile;
 class cmSourceFile;
 class cmSourceGroup;
 
+class cmVS7GeneratorOptions : public cmVisualStudioGeneratorOptions
+{
+public:
+  cmVS7GeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
+                        cmVS7FlagTable const* table = nullptr,
+                        cmVS7FlagTable const* extraTable = nullptr)
+    : cmVisualStudioGeneratorOptions(lg, tool, table, extraTable)
+  {
+  }
+  void OutputFlag(std::ostream& fout, const char* indent, const char* tag,
+                  const std::string& content) override;
+};
+
 /** \class cmLocalVisualStudio7Generator
  * \brief Write Visual Studio .NET project files.
  *
@@ -70,7 +83,7 @@ protected:
   void CreateSingleVCProj(const std::string& lname, cmGeneratorTarget* tgt);
 
 private:
-  typedef cmVisualStudioGeneratorOptions Options;
+  typedef cmVS7GeneratorOptions Options;
   typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
   std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
                                       const std::string& configName);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7e6e803..f1aed88 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -18,6 +18,16 @@
 #include <iterator>
 #include <memory> // IWYU pragma: keep
 
+static void ConvertToWindowsSlash(std::string& s);
+
+static std::string cmVS10EscapeXML(std::string arg)
+{
+  cmSystemTools::ReplaceString(arg, "&", "&");
+  cmSystemTools::ReplaceString(arg, "<", "<");
+  cmSystemTools::ReplaceString(arg, ">", ">");
+  return arg;
+}
+
 struct cmVisualStudio10TargetGenerator::Elem
 {
   cmGeneratedFileStream& S;
@@ -57,6 +67,37 @@ struct cmVisualStudio10TargetGenerator::Elem
   }
 };
 
+class cmVS10GeneratorOptions : public cmVisualStudioGeneratorOptions
+{
+public:
+  cmVS10GeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
+                         cmVS7FlagTable const* table,
+                         cmVisualStudio10TargetGenerator* g = nullptr)
+    : cmVisualStudioGeneratorOptions(lg, tool, table)
+    , TargetGenerator(g)
+  {
+  }
+
+  void OutputFlag(std::ostream& fout, const char* indent, const char* tag,
+                  const std::string& content) override
+  {
+    if (!this->GetConfiguration().empty()) {
+      // if there are configuration specific flags, then
+      // use the configuration specific tag for PreprocessorDefinitions
+      fout << indent;
+      this->TargetGenerator->WritePlatformConfigTag(
+        tag, this->GetConfiguration(), 0, 0, 0, &fout);
+    } else {
+      fout << indent << "<" << tag << ">";
+    }
+    fout << cmVS10EscapeXML(content);
+    fout << "</" << tag << ">";
+  }
+
+private:
+  cmVisualStudio10TargetGenerator* TargetGenerator;
+};
+
 inline void cmVisualStudio10TargetGenerator::WriteElem(const char* tag,
                                                        const char* val,
                                                        int indentLevel)
@@ -73,16 +114,6 @@ inline void cmVisualStudio10TargetGenerator::WriteElem(const char* tag,
   (*this->BuildFileStream) << tag << ">" << val << "</" << tag << ">\n";
 }
 
-static void ConvertToWindowsSlash(std::string& s);
-
-static std::string cmVS10EscapeXML(std::string arg)
-{
-  cmSystemTools::ReplaceString(arg, "&", "&");
-  cmSystemTools::ReplaceString(arg, "<", "<");
-  cmSystemTools::ReplaceString(arg, ">", ">");
-  return arg;
-}
-
 inline void cmVisualStudio10TargetGenerator::WriteElemEscapeXML(
   const char* tag, std::string const& val, int indentLevel)
 {
@@ -2048,9 +2079,9 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
       cmGeneratorExpressionInterpreter genexInterpreter(
         this->LocalGenerator, this->GeneratorTarget, config,
         this->GeneratorTarget->GetName(), lang);
-      cmVisualStudioGeneratorOptions clOptions(
+      cmVS10GeneratorOptions clOptions(
         this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler,
-        flagtable, 0, this);
+        flagtable, this);
       if (compileAs) {
         clOptions.AddFlag("CompileAs", compileAs);
       }
@@ -2893,9 +2924,9 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions(
   if (!libflags.empty()) {
     this->WriteString("<Lib>\n", 2);
     cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
-    cmVisualStudioGeneratorOptions libOptions(
-      this->LocalGenerator, cmVisualStudioGeneratorOptions::Linker,
-      gg->GetLibFlagTable(), 0, this);
+    cmVS10GeneratorOptions libOptions(this->LocalGenerator,
+                                      cmVisualStudioGeneratorOptions::Linker,
+                                      gg->GetLibFlagTable(), this);
     libOptions.Parse(libflags.c_str());
     libOptions.PrependInheritedString("AdditionalOptions");
     libOptions.OutputFlagMap(*this->BuildFileStream, "      ");
@@ -3063,9 +3094,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::string const& config)
 {
   cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
-  auto pOptions =
-    cm::make_unique<Options>(this->LocalGenerator, Options::Linker,
-                             gg->GetLinkFlagTable(), nullptr, this);
+  auto pOptions = cm::make_unique<Options>(
+    this->LocalGenerator, Options::Linker, gg->GetLinkFlagTable(), this);
   Options& linkOptions = *pOptions;
 
   cmGeneratorTarget::LinkClosure const* linkClosure =
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index d557255..87f735d 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -21,7 +21,7 @@ class cmLocalVisualStudio7Generator;
 class cmMakefile;
 class cmSourceFile;
 class cmSourceGroup;
-class cmVisualStudioGeneratorOptions;
+class cmVS10GeneratorOptions;
 
 class cmVisualStudio10TargetGenerator
 {
@@ -176,7 +176,7 @@ private:
   void GetCSharpSourceLink(cmSourceFile const* sf, std::string& link);
 
 private:
-  typedef cmVisualStudioGeneratorOptions Options;
+  typedef cmVS10GeneratorOptions Options;
   typedef std::map<std::string, std::unique_ptr<Options>> OptionsMap;
   OptionsMap ClOptions;
   OptionsMap RcOptions;
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 7d7000b..26fce4b 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -4,47 +4,19 @@
 #include "cmLocalVisualStudioGenerator.h"
 #include "cmOutputConverter.h"
 #include "cmSystemTools.h"
-#include "cmVisualStudio10TargetGenerator.h"
 
 static void cmVS10EscapeForMSBuild(std::string& ret)
 {
   cmSystemTools::ReplaceString(ret, ";", "%3B");
 }
 
-static std::string cmVisualStudio10GeneratorOptionsEscapeForXML(
-  std::string ret)
-{
-  cmSystemTools::ReplaceString(ret, "&", "&");
-  cmSystemTools::ReplaceString(ret, "<", "<");
-  cmSystemTools::ReplaceString(ret, ">", ">");
-  return ret;
-}
-
-static std::string cmVisualStudioGeneratorOptionsEscapeForXML(std::string ret)
-{
-  cmSystemTools::ReplaceString(ret, "&", "&");
-  cmSystemTools::ReplaceString(ret, "\"", """);
-  cmSystemTools::ReplaceString(ret, "<", "<");
-  cmSystemTools::ReplaceString(ret, ">", ">");
-  cmSystemTools::ReplaceString(ret, "\n", "&#x0D;&#x0A;");
-  return ret;
-}
-
-cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
-  cmLocalVisualStudioGenerator* lg, Tool tool,
-  cmVisualStudio10TargetGenerator* g)
-  : cmVisualStudioGeneratorOptions(lg, tool, nullptr, nullptr, g)
-{
-}
-
 cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
   cmLocalVisualStudioGenerator* lg, Tool tool, cmVS7FlagTable const* table,
-  cmVS7FlagTable const* extraTable, cmVisualStudio10TargetGenerator* g)
+  cmVS7FlagTable const* extraTable)
   : cmIDEOptions()
   , LocalGenerator(lg)
   , Version(lg->GetVersion())
   , CurrentTool(tool)
-  , TargetGenerator(g)
 {
   // Store the given flag tables.
   this->AddTable(table);
@@ -444,28 +416,9 @@ void cmVisualStudioGeneratorOptions::SetConfiguration(
   this->Configuration = config;
 }
 
-void cmVisualStudioGeneratorOptions::OutputFlag(std::ostream& fout,
-                                                const char* indent,
-                                                const char* tag,
-                                                const std::string& content)
+const std::string& cmVisualStudioGeneratorOptions::GetConfiguration() const
 {
-  if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    if (!this->Configuration.empty()) {
-      // if there are configuration specific flags, then
-      // use the configuration specific tag for PreprocessorDefinitions
-      fout << indent;
-      this->TargetGenerator->WritePlatformConfigTag(tag, this->Configuration,
-                                                    0, 0, 0, &fout);
-    } else {
-      fout << indent << "<" << tag << ">";
-    }
-    fout << cmVisualStudio10GeneratorOptionsEscapeForXML(content);
-    fout << "</" << tag << ">";
-  } else {
-    fout << indent << tag << "=\"";
-    fout << cmVisualStudioGeneratorOptionsEscapeForXML(content);
-    fout << "\"";
-  }
+  return this->Configuration;
 }
 
 void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 517760a..40290d1 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -16,8 +16,6 @@ class cmLocalVisualStudioGenerator;
 
 typedef cmIDEFlagTable cmVS7FlagTable;
 
-class cmVisualStudio10TargetGenerator;
-
 class cmVisualStudioGeneratorOptions : public cmIDEOptions
 {
 public:
@@ -34,12 +32,8 @@ public:
     CSharpCompiler
   };
   cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
-                                 cmVS7FlagTable const* table,
-                                 cmVS7FlagTable const* extraTable = 0,
-                                 cmVisualStudio10TargetGenerator* g = 0);
-
-  cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
-                                 cmVisualStudio10TargetGenerator* g = 0);
+                                 cmVS7FlagTable const* table = nullptr,
+                                 cmVS7FlagTable const* extraTable = nullptr);
 
   // Add a table of flags.
   void AddTable(cmVS7FlagTable const* table);
@@ -92,10 +86,11 @@ public:
                                           const std::string& lang);
   void OutputFlagMap(std::ostream& fout, const char* indent);
   void SetConfiguration(const std::string& config);
+  const std::string& GetConfiguration() const;
 
-private:
-  void OutputFlag(std::ostream& fout, const char* indent, const char* tag,
-                  const std::string& content);
+protected:
+  virtual void OutputFlag(std::ostream& fout, const char* indent,
+                          const char* tag, const std::string& content) = 0;
 
 private:
   cmLocalVisualStudioGenerator* LocalGenerator;
@@ -103,7 +98,6 @@ private:
 
   std::string Configuration;
   Tool CurrentTool;
-  cmVisualStudio10TargetGenerator* TargetGenerator;
 
   bool FortranRuntimeDebug;
   bool FortranRuntimeDLL;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70c50aa23cc993a502cd3c87be8afb79d973b50e
commit 70c50aa23cc993a502cd3c87be8afb79d973b50e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 26 07:29:48 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 26 07:44:22 2018 -0400

    Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"
    
    Revert commit v3.8.0-rc1~305^2 (Remove CTestTestfile.cmake when BUILD_TESTING
    is OFF, 2016-11-14) again.  We reverted it once in commit v3.8.0-rc3~22^2
    (Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF", 2017-03-06) but
    it was accidentally restored by commit v3.11.0-rc1~387^2 (server: add
    "ctestInfo" request to get test info, 2017-10-25), perhaps due to conflict
    resolution during rebase.
    
    We cannot remove `CTestTestfile.cmake` when testing is off because it breaks
    projects that never enable testing but create their own `CTestTestfile.cmake`
    manually instead.  Revert the change again and add a test case.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index cee540b..e942ff4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -224,14 +224,7 @@ void cmLocalGenerator::TraceDependencies()
 
 void cmLocalGenerator::GenerateTestFiles()
 {
-  std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary();
-  file += "/";
-  file += "CTestTestfile.cmake";
-
   if (!this->Makefile->IsOn("CMAKE_TESTING_ENABLED")) {
-    if (cmSystemTools::FileExists(file)) {
-      cmSystemTools::RemoveFile(file);
-    }
     return;
   }
 
@@ -240,6 +233,10 @@ void cmLocalGenerator::GenerateTestFiles()
   const std::string& config =
     this->Makefile->GetConfigurations(configurationTypes, false);
 
+  std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary();
+  file += "/";
+  file += "CTestTestfile.cmake";
+
   cmGeneratedFileStream fout(file.c_str());
   fout.SetCopyIfDifferent(true);
 
diff --git a/Tests/RunCMake/CTest/CTestTestfile.cmake.in b/Tests/RunCMake/CTest/CTestTestfile.cmake.in
new file mode 100644
index 0000000..0763244
--- /dev/null
+++ b/Tests/RunCMake/CTest/CTestTestfile.cmake.in
@@ -0,0 +1 @@
+# Created manually
diff --git a/Tests/RunCMake/CTest/NotOn-check.cmake b/Tests/RunCMake/CTest/NotOn-check.cmake
new file mode 100644
index 0000000..b68218a
--- /dev/null
+++ b/Tests/RunCMake/CTest/NotOn-check.cmake
@@ -0,0 +1,8 @@
+set(f "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
+if(NOT EXISTS "${f}")
+  set(RunCMake_TEST_FAILED "File does not exist:\n  ${f}")
+endif()
+file(READ ${f} content)
+if(NOT "${content}" MATCHES "^# Created manually")
+  set(RunCMake_TEST_FAILED "File:\n  ${f}\nhas unexpected content:\n  ${content}")
+endif()
diff --git a/Tests/RunCMake/CTest/NotOn.cmake b/Tests/RunCMake/CTest/NotOn.cmake
new file mode 100644
index 0000000..7fba019
--- /dev/null
+++ b/Tests/RunCMake/CTest/NotOn.cmake
@@ -0,0 +1,3 @@
+set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
+include(CTest)
+configure_file(CTestTestfile.cmake.in CTestTestfile.cmake)
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
index a6f6842..1392240 100644
--- a/Tests/RunCMake/CTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
 set(RunCMake_TEST_OPTIONS -DNoProject=1)
 run_cmake(BeforeProject)
 unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(NotOn)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85468e0754fb984aa5d042d07f8e52b67e969741
commit 85468e0754fb984aa5d042d07f8e52b67e969741
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Thu Mar 22 18:31:29 2018 -0400
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Thu Mar 22 18:31:29 2018 -0400

    cmComputeLinkInformation: make some members const

diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b82fc43..6e6e0be 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -240,21 +240,19 @@ because this need be done only for shared libraries without soname-s.
 
 cmComputeLinkInformation::cmComputeLinkInformation(
   const cmGeneratorTarget* target, const std::string& config)
-{
   // Store context information.
-  this->Target = target;
-  this->Makefile = this->Target->Target->GetMakefile();
-  this->GlobalGenerator =
-    this->Target->GetLocalGenerator()->GetGlobalGenerator();
-  this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
-
+  : Target(target),
+    Makefile(target->Target->GetMakefile()),
+    GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()),
+    CMakeInstance(this->GlobalGenerator->GetCMakeInstance())
+    // The configuration being linked.
+    ,
+    Config(config)
+{
   // Check whether to recognize OpenBSD-style library versioned names.
   this->OpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool(
     "FIND_LIBRARY_USE_OPENBSD_VERSIONING");
 
-  // The configuration being linked.
-  this->Config = config;
-
   // Allocate internals.
   this->OrderLinkerSearchPath = new cmOrderDirectories(
     this->GlobalGenerator, target, "linker search path");
@@ -412,11 +410,12 @@ cmComputeLinkInformation::GetItems() const
 }
 
 std::vector<std::string> const& cmComputeLinkInformation::GetDirectories()
+  const
 {
   return this->OrderLinkerSearchPath->GetOrderedDirectories();
 }
 
-std::string cmComputeLinkInformation::GetRPathLinkString()
+std::string cmComputeLinkInformation::GetRPathLinkString() const
 {
   // If there is no separate linker runtime search flag (-rpath-link)
   // there is no reason to compute a string.
@@ -428,18 +427,19 @@ std::string cmComputeLinkInformation::GetRPathLinkString()
   return cmJoin(this->OrderDependentRPath->GetOrderedDirectories(), ":");
 }
 
-std::vector<std::string> const& cmComputeLinkInformation::GetDepends()
+std::vector<std::string> const& cmComputeLinkInformation::GetDepends() const
 {
   return this->Depends;
 }
 
 std::vector<std::string> const& cmComputeLinkInformation::GetFrameworkPaths()
+  const
 {
   return this->FrameworkPaths;
 }
 
 const std::set<const cmGeneratorTarget*>&
-cmComputeLinkInformation::GetSharedLibrariesLinked()
+cmComputeLinkInformation::GetSharedLibrariesLinked() const
 {
   return this->SharedLibrariesLinked;
 }
@@ -1026,7 +1026,7 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
       (generator.find("Visual Studio") != std::string::npos ||
        generator.find("Xcode") != std::string::npos)) {
     std::string file = cmSystemTools::GetFilenameName(item);
-    if (!this->ExtractAnyLibraryName.find(file.c_str())) {
+    if (!this->ExtractAnyLibraryName.find(file)) {
       this->HandleBadFullItem(item, file);
       return;
     }
@@ -1233,7 +1233,7 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item,
 void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
 {
   // Try to separate the framework name and path.
-  if (!this->SplitFramework.find(item.c_str())) {
+  if (!this->SplitFramework.find(item)) {
     std::ostringstream e;
     e << "Could not parse framework path \"" << item << "\" "
       << "linked by target " << this->Target->GetName() << ".";
@@ -1572,7 +1572,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
 }
 
 std::vector<std::string> const&
-cmComputeLinkInformation::GetRuntimeSearchPath()
+cmComputeLinkInformation::GetRuntimeSearchPath() const
 {
   return this->OrderRuntimeSearchPath->GetOrderedDirectories();
 }
@@ -1638,7 +1638,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(
   if (!is_shared_library) {
     // On some platforms (AIX) a shared library may look static.
     if (this->ArchivesMayBeShared) {
-      if (this->ExtractStaticLibraryName.find(file.c_str())) {
+      if (this->ExtractStaticLibraryName.find(file)) {
         // This is the name of a shared library or archive.
         is_shared_library = true;
       }
@@ -1683,7 +1683,7 @@ static void cmCLI_ExpandListUnique(const char* str,
 }
 
 void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
-                                        bool for_install)
+                                        bool for_install) const
 {
   // Select whether to generate runtime search directories.
   bool outputRuntime =
@@ -1797,7 +1797,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
   cmCLI_ExpandListUnique(this->RuntimeAlways.c_str(), runtimeDirs, emitted);
 }
 
-std::string cmComputeLinkInformation::GetRPathString(bool for_install)
+std::string cmComputeLinkInformation::GetRPathString(bool for_install) const
 {
   // Get the directories to use.
   std::vector<std::string> runtimeDirs;
@@ -1825,7 +1825,7 @@ std::string cmComputeLinkInformation::GetRPathString(bool for_install)
   return rpath;
 }
 
-std::string cmComputeLinkInformation::GetChrpathString()
+std::string cmComputeLinkInformation::GetChrpathString() const
 {
   if (!this->RuntimeUseChrpath) {
     return "";
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 6c67fb4..65c12da 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -49,20 +49,20 @@ public:
   };
   typedef std::vector<Item> ItemVector;
   ItemVector const& GetItems() const;
-  std::vector<std::string> const& GetDirectories();
-  std::vector<std::string> const& GetDepends();
-  std::vector<std::string> const& GetFrameworkPaths();
+  std::vector<std::string> const& GetDirectories() const;
+  std::vector<std::string> const& GetDepends() const;
+  std::vector<std::string> const& GetFrameworkPaths() const;
   std::string GetLinkLanguage() const { return this->LinkLanguage; }
-  std::vector<std::string> const& GetRuntimeSearchPath();
+  std::vector<std::string> const& GetRuntimeSearchPath() const;
   std::string const& GetRuntimeFlag() const { return this->RuntimeFlag; }
   std::string const& GetRuntimeSep() const { return this->RuntimeSep; }
-  void GetRPath(std::vector<std::string>& runtimeDirs, bool for_install);
-  std::string GetRPathString(bool for_install);
-  std::string GetChrpathString();
-  std::set<cmGeneratorTarget const*> const& GetSharedLibrariesLinked();
+  void GetRPath(std::vector<std::string>& runtimeDirs, bool for_install) const;
+  std::string GetRPathString(bool for_install) const;
+  std::string GetChrpathString() const;
+  std::set<cmGeneratorTarget const*> const& GetSharedLibrariesLinked() const;
 
   std::string const& GetRPathLinkFlag() const { return this->RPathLinkFlag; }
-  std::string GetRPathLinkString();
+  std::string GetRPathLinkString() const;
 
   std::string GetConfig() const { return this->Config; }
 private:
@@ -78,13 +78,13 @@ private:
   std::set<cmGeneratorTarget const*> SharedLibrariesLinked;
 
   // Context information.
-  cmGeneratorTarget const* Target;
-  cmMakefile* Makefile;
-  cmGlobalGenerator* GlobalGenerator;
-  cmake* CMakeInstance;
+  cmGeneratorTarget const* const Target;
+  cmMakefile* const Makefile;
+  cmGlobalGenerator* const GlobalGenerator;
+  cmake* const CMakeInstance;
 
   // Configuration information.
-  std::string Config;
+  std::string const Config;
   std::string LinkLanguage;
 
   // Modes for dealing with dependent shared libraries.

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

Summary of changes:
 Source/cmComputeLinkInformation.cxx         |   40 ++++++++--------
 Source/cmComputeLinkInformation.h           |   28 ++++++------
 Source/cmLocalGenerator.cxx                 |   11 ++---
 Source/cmLocalVisualStudio7Generator.cxx    |    9 ++++
 Source/cmLocalVisualStudio7Generator.h      |   15 +++++-
 Source/cmVisualStudio10TargetGenerator.cxx  |   66 +++++++++++++++++++--------
 Source/cmVisualStudio10TargetGenerator.h    |    4 +-
 Source/cmVisualStudioGeneratorOptions.cxx   |   53 ++-------------------
 Source/cmVisualStudioGeneratorOptions.h     |   18 +++-----
 Tests/RunCMake/CTest/CTestTestfile.cmake.in |    1 +
 Tests/RunCMake/CTest/NotOn-check.cmake      |    8 ++++
 Tests/RunCMake/CTest/NotOn.cmake            |    3 ++
 Tests/RunCMake/CTest/RunCMakeTest.cmake     |    2 +
 13 files changed, 134 insertions(+), 124 deletions(-)
 create mode 100644 Tests/RunCMake/CTest/CTestTestfile.cmake.in
 create mode 100644 Tests/RunCMake/CTest/NotOn-check.cmake
 create mode 100644 Tests/RunCMake/CTest/NotOn.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list