[Cmake-commits] CMake branch, next, updated. v3.7.1-1738-g0c61ea6

Brad King brad.king at kitware.com
Tue Dec 13 12:51:36 EST 2016


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, next has been updated
       via  0c61ea6263aac5c8d98eb72a1478c2032b65b014 (commit)
       via  656cd0267a76d871ff469bd1d0777294d1168047 (commit)
      from  21eecae3d33670082ba19e6380adee9bfff0ba18 (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=0c61ea6263aac5c8d98eb72a1478c2032b65b014
commit 0c61ea6263aac5c8d98eb72a1478c2032b65b014
Merge: 21eecae 656cd02
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 13 12:51:35 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 13 12:51:35 2016 -0500

    Merge topic 'codelite-build-and-clean-targets-enhancement' into next
    
    656cd026 Revert "CodeLite: Make build/clean/rebuild operations optionally target-centric"


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=656cd0267a76d871ff469bd1d0777294d1168047
commit 656cd0267a76d871ff469bd1d0777294d1168047
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 13 12:51:27 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 13 12:51:27 2016 -0500

    Revert "CodeLite: Make build/clean/rebuild operations optionally target-centric"
    
    This reverts commit 84276519414640af8f635ebf36f2e47519caac40.

diff --git a/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst b/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst
deleted file mode 100644
index c6b78cf..0000000
--- a/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-codelite-build-and-clean-targets-enhancement
---------------------------------------------
-
-* The :generator:`CodeLite` extra generator gained a new option
-  set by the :variable:`CMAKE_CODELITE_USE_TARGETS` variable to
-  change the generated project to have target-centric organization.
-  The "build", "rebuild", and "clean" operations within CodeLite
-  then work on a selected target rather than the whole workspace.
-  (Note that the :generator:`Ninja` clean operation on a target
-  includes its dependencies, though.)
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 1403588..e79f763 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -129,13 +129,12 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget(
          lt != (*lg)->GetGeneratorTargets().end(); lt++) {
       cmStateEnums::TargetType type = (*lt)->GetType();
       std::string outputDir = (*lg)->GetCurrentBinaryDirectory();
-      std::string targetName = (*lt)->GetName();
-      std::string filename = outputDir + "/" + targetName + ".project";
-      retval.push_back(targetName);
+      std::string filename = outputDir + "/" + (*lt)->GetName() + ".project";
+      retval.push_back((*lt)->GetName());
       // Make the project file relative to the workspace
       std::string relafilename = cmSystemTools::RelativePath(
         this->WorkspacePath.c_str(), filename.c_str());
-      std::string visualname = targetName;
+      std::string visualname = (*lt)->GetName();
       switch (type) {
         case cmStateEnums::SHARED_LIBRARY:
         case cmStateEnums::STATIC_LIBRARY:
@@ -303,7 +302,7 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
   std::string projectPath = cmSystemTools::GetFilenamePath(filename);
 
   CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
-                             projectType, "");
+                             projectType);
 
   xml.EndElement(); // CodeLite_Project
 }
@@ -353,7 +352,7 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
   std::map<std::string, cmSourceFile*>& cFiles,
   std::set<std::string>& otherFiles, cmXMLWriter* _xml,
   const std::string& projectPath, const cmMakefile* mf,
-  const std::string& projectType, const std::string& targetName)
+  const std::string& projectType)
 {
 
   cmXMLWriter& xml(*_xml);
@@ -431,10 +430,8 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
 
   xml.StartElement("General");
   std::string outputPath = mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
-  std::string relapath = cmSystemTools::RelativePath(
-    this->WorkspacePath.c_str(), outputPath.c_str());
   if (!outputPath.empty()) {
-    xml.Attribute("OutputFile", relapath + "/$(ProjectName)");
+    xml.Attribute("OutputFile", outputPath + "/$(ProjectName)");
   } else {
     xml.Attribute("OutputFile", "$(IntermediateDirectory)/$(ProjectName)");
   }
@@ -442,7 +439,7 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
   xml.Attribute("Command", "./$(ProjectName)");
   xml.Attribute("CommandArguments", "");
   if (!outputPath.empty()) {
-    xml.Attribute("WorkingDirectory", relapath);
+    xml.Attribute("WorkingDirectory", outputPath);
   } else {
     xml.Attribute("WorkingDirectory", "$(IntermediateDirectory)");
   }
@@ -463,9 +460,9 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
 
   xml.StartElement("CustomBuild");
   xml.Attribute("Enabled", "yes");
-  xml.Element("RebuildCommand", GetRebuildCommand(mf, targetName));
-  xml.Element("CleanCommand", GetCleanCommand(mf, targetName));
-  xml.Element("BuildCommand", GetBuildCommand(mf, targetName));
+  xml.Element("RebuildCommand", GetRebuildCommand(mf));
+  xml.Element("CleanCommand", GetCleanCommand(mf));
+  xml.Element("BuildCommand", GetBuildCommand(mf));
   xml.Element("SingleFileCommand", GetSingleFileBuildCommand(mf));
   xml.Element("PreprocessFileCommand");
   xml.Element("WorkingDirectory", "$(WorkspacePath)");
@@ -514,13 +511,12 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
   ////////////////////////////////////
   xml.StartDocument("utf-8");
   xml.StartElement("CodeLite_Project");
-  std::string targetName = gt->GetName();
-  std::string visualname = targetName;
+  std::string visualname = gt->GetName();
   switch (gt->GetType()) {
     case cmStateEnums::STATIC_LIBRARY:
     case cmStateEnums::SHARED_LIBRARY:
     case cmStateEnums::MODULE_LIBRARY:
-      visualname = "lib" + targetName;
+      visualname = "lib" + visualname;
     default: // intended fallthrough
       break;
   }
@@ -545,7 +541,7 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
   std::string projectPath = cmSystemTools::GetFilenamePath(filename);
 
   CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
-                             projectType, targetName);
+                             projectType);
 
   xml.EndElement(); // CodeLite_Project
 }
@@ -590,43 +586,31 @@ std::string cmExtraCodeLiteGenerator::GetConfigurationName(
 }
 
 std::string cmExtraCodeLiteGenerator::GetBuildCommand(
-  const cmMakefile* mf, const std::string& targetName) const
+  const cmMakefile* mf) const
 {
   std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
   std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   std::string buildCommand = make; // Default
-  std::ostringstream ss;
   if (generator == "NMake Makefiles" || generator == "Ninja") {
-    ss << make;
+    buildCommand = make;
   } else if (generator == "MinGW Makefiles" || generator == "Unix Makefiles") {
+    std::ostringstream ss;
     ss << make << " -j " << this->CpuCount;
+    buildCommand = ss.str();
   }
-  if (!targetName.empty()) {
-    ss << " " << targetName;
-  }
-  buildCommand = ss.str();
   return buildCommand;
 }
 
 std::string cmExtraCodeLiteGenerator::GetCleanCommand(
-  const cmMakefile* mf, const std::string& targetName) const
+  const cmMakefile* mf) const
 {
-  std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
-  std::ostringstream ss;
-  std::string buildcommand = GetBuildCommand(mf, "");
-  if (!targetName.empty() && generator == "Ninja") {
-    ss << buildcommand << " -t clean " << targetName;
-  } else {
-    ss << buildcommand << " clean";
-  }
-  return ss.str();
+  return GetBuildCommand(mf) + " clean";
 }
 
 std::string cmExtraCodeLiteGenerator::GetRebuildCommand(
-  const cmMakefile* mf, const std::string& targetName) const
+  const cmMakefile* mf) const
 {
-  return GetCleanCommand(mf, targetName) + " && " +
-    GetBuildCommand(mf, targetName);
+  return GetCleanCommand(mf) + " && " + GetBuildCommand(mf);
 }
 
 std::string cmExtraCodeLiteGenerator::GetSingleFileBuildCommand(
diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h
index 773515d..a349db5 100644
--- a/Source/cmExtraCodeLiteGenerator.h
+++ b/Source/cmExtraCodeLiteGenerator.h
@@ -28,12 +28,9 @@ protected:
 protected:
   std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;
   std::string GetConfigurationName(const cmMakefile* mf) const;
-  std::string GetBuildCommand(const cmMakefile* mf,
-                              const std::string& targetName) const;
-  std::string GetCleanCommand(const cmMakefile* mf,
-                              const std::string& targetName) const;
-  std::string GetRebuildCommand(const cmMakefile* mf,
-                                const std::string& targetName) const;
+  std::string GetBuildCommand(const cmMakefile* mf) const;
+  std::string GetCleanCommand(const cmMakefile* mf) const;
+  std::string GetRebuildCommand(const cmMakefile* mf) const;
   std::string GetSingleFileBuildCommand(const cmMakefile* mf) const;
   std::vector<std::string> CreateProjectsByTarget(cmXMLWriter* xml);
   std::vector<std::string> CreateProjectsByProjectMaps(cmXMLWriter* xml);
@@ -48,8 +45,7 @@ protected:
                                   cmXMLWriter* xml,
                                   const std::string& projectPath,
                                   const cmMakefile* mf,
-                                  const std::string& projectType,
-                                  const std::string& targetName);
+                                  const std::string& projectType);
 
 public:
   cmExtraCodeLiteGenerator();

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

Summary of changes:
 ...odelite-build-and-clean-targets-enhancement.rst |   10 ----
 Source/cmExtraCodeLiteGenerator.cxx                |   58 +++++++-------------
 Source/cmExtraCodeLiteGenerator.h                  |   12 ++--
 3 files changed, 25 insertions(+), 55 deletions(-)
 delete mode 100644 Help/release/dev/codelite-build-and-clean-targets-enhancement.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list