diff options
-rw-r--r-- | Help/release/dev/codelite-build-and-clean-targets-enhancement.rst | 10 | ||||
-rw-r--r-- | Help/variable/CMAKE_CL_64.rst | 5 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 59 | ||||
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.h | 12 | ||||
-rw-r--r-- | Source/kwsys/.gitattributes | 4 | ||||
-rw-r--r-- | Source/kwsys/CONTRIBUTING.rst | 29 | ||||
-rw-r--r-- | Source/kwsys/README.rst | 37 | ||||
-rw-r--r-- | Source/kwsys/README.txt | 12 | ||||
-rwxr-xr-x | Utilities/Scripts/update-kwsys.bash | 2 |
10 files changed, 114 insertions, 58 deletions
diff --git a/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst b/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst new file mode 100644 index 0000000..c6b78cf --- /dev/null +++ b/Help/release/dev/codelite-build-and-clean-targets-enhancement.rst @@ -0,0 +1,10 @@ +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/Help/variable/CMAKE_CL_64.rst b/Help/variable/CMAKE_CL_64.rst index a1e86a5..4e80d1f 100644 --- a/Help/variable/CMAKE_CL_64.rst +++ b/Help/variable/CMAKE_CL_64.rst @@ -1,6 +1,7 @@ CMAKE_CL_64 ----------- -Using the 64-bit compiler from Microsoft +Discouraged. Use :variable:`CMAKE_SIZEOF_VOID_P` instead. -Set to ``true`` when using the 64-bit ``cl`` compiler from Microsoft. +Set to a true value when using a Microsoft Visual Studio ``cl`` compiler that +*targets* a 64-bit architecture. diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7cec5e0..c41fe3a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) -set(CMake_VERSION_PATCH 20161214) +set(CMake_VERSION_PATCH 20161215) #set(CMake_VERSION_RC 1) diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index e79f763..fd7da18 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -129,12 +129,13 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget( lt != (*lg)->GetGeneratorTargets().end(); lt++) { cmStateEnums::TargetType type = (*lt)->GetType(); std::string outputDir = (*lg)->GetCurrentBinaryDirectory(); - std::string filename = outputDir + "/" + (*lt)->GetName() + ".project"; - retval.push_back((*lt)->GetName()); + std::string targetName = (*lt)->GetName(); + std::string filename = outputDir + "/" + targetName + ".project"; + retval.push_back(targetName); // Make the project file relative to the workspace std::string relafilename = cmSystemTools::RelativePath( this->WorkspacePath.c_str(), filename.c_str()); - std::string visualname = (*lt)->GetName(); + std::string visualname = targetName; switch (type) { case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::STATIC_LIBRARY: @@ -302,7 +303,7 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( std::string projectPath = cmSystemTools::GetFilenamePath(filename); CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf, - projectType); + projectType, ""); xml.EndElement(); // CodeLite_Project } @@ -352,7 +353,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& projectType, const std::string& targetName) { cmXMLWriter& xml(*_xml); @@ -430,8 +431,11 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries( xml.StartElement("General"); std::string outputPath = mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"); + std::string relapath; if (!outputPath.empty()) { - xml.Attribute("OutputFile", outputPath + "/$(ProjectName)"); + relapath = cmSystemTools::RelativePath(this->WorkspacePath.c_str(), + outputPath.c_str()); + xml.Attribute("OutputFile", relapath + "/$(ProjectName)"); } else { xml.Attribute("OutputFile", "$(IntermediateDirectory)/$(ProjectName)"); } @@ -439,7 +443,7 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries( xml.Attribute("Command", "./$(ProjectName)"); xml.Attribute("CommandArguments", ""); if (!outputPath.empty()) { - xml.Attribute("WorkingDirectory", outputPath); + xml.Attribute("WorkingDirectory", relapath); } else { xml.Attribute("WorkingDirectory", "$(IntermediateDirectory)"); } @@ -460,9 +464,9 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries( xml.StartElement("CustomBuild"); xml.Attribute("Enabled", "yes"); - xml.Element("RebuildCommand", GetRebuildCommand(mf)); - xml.Element("CleanCommand", GetCleanCommand(mf)); - xml.Element("BuildCommand", GetBuildCommand(mf)); + xml.Element("RebuildCommand", GetRebuildCommand(mf, targetName)); + xml.Element("CleanCommand", GetCleanCommand(mf, targetName)); + xml.Element("BuildCommand", GetBuildCommand(mf, targetName)); xml.Element("SingleFileCommand", GetSingleFileBuildCommand(mf)); xml.Element("PreprocessFileCommand"); xml.Element("WorkingDirectory", "$(WorkspacePath)"); @@ -511,12 +515,13 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( //////////////////////////////////// xml.StartDocument("utf-8"); xml.StartElement("CodeLite_Project"); - std::string visualname = gt->GetName(); + std::string targetName = gt->GetName(); + std::string visualname = targetName; switch (gt->GetType()) { case cmStateEnums::STATIC_LIBRARY: case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: - visualname = "lib" + visualname; + visualname = "lib" + targetName; default: // intended fallthrough break; } @@ -541,7 +546,7 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( std::string projectPath = cmSystemTools::GetFilenamePath(filename); CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf, - projectType); + projectType, targetName); xml.EndElement(); // CodeLite_Project } @@ -586,31 +591,43 @@ std::string cmExtraCodeLiteGenerator::GetConfigurationName( } std::string cmExtraCodeLiteGenerator::GetBuildCommand( - const cmMakefile* mf) const + const cmMakefile* mf, const std::string& targetName) 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") { - buildCommand = make; + ss << 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 + const cmMakefile* mf, const std::string& targetName) const { - return GetBuildCommand(mf) + " clean"; + 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(); } std::string cmExtraCodeLiteGenerator::GetRebuildCommand( - const cmMakefile* mf) const + const cmMakefile* mf, const std::string& targetName) const { - return GetCleanCommand(mf) + " && " + GetBuildCommand(mf); + return GetCleanCommand(mf, targetName) + " && " + + GetBuildCommand(mf, targetName); } std::string cmExtraCodeLiteGenerator::GetSingleFileBuildCommand( diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h index a349db5..773515d 100644 --- a/Source/cmExtraCodeLiteGenerator.h +++ b/Source/cmExtraCodeLiteGenerator.h @@ -28,9 +28,12 @@ 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 GetCleanCommand(const cmMakefile* mf) const; - std::string GetRebuildCommand(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 GetSingleFileBuildCommand(const cmMakefile* mf) const; std::vector<std::string> CreateProjectsByTarget(cmXMLWriter* xml); std::vector<std::string> CreateProjectsByProjectMaps(cmXMLWriter* xml); @@ -45,7 +48,8 @@ protected: cmXMLWriter* xml, const std::string& projectPath, const cmMakefile* mf, - const std::string& projectType); + const std::string& projectType, + const std::string& targetName); public: cmExtraCodeLiteGenerator(); diff --git a/Source/kwsys/.gitattributes b/Source/kwsys/.gitattributes index a9c4e77..a121ad1 100644 --- a/Source/kwsys/.gitattributes +++ b/Source/kwsys/.gitattributes @@ -1,7 +1,5 @@ .git* export-ignore -/CONTRIBUTING.rst conflict-marker-size=78 - *.c whitespace=tab-in-indent,no-lf-at-eof *.h whitespace=tab-in-indent,no-lf-at-eof *.h.in whitespace=tab-in-indent,no-lf-at-eof @@ -10,3 +8,5 @@ *.hxx.in whitespace=tab-in-indent,no-lf-at-eof *.txt whitespace=tab-in-indent,no-lf-at-eof *.cmake whitespace=tab-in-indent,no-lf-at-eof + +*.rst whitespace=tab-in-indent conflict-marker-size=79 diff --git a/Source/kwsys/CONTRIBUTING.rst b/Source/kwsys/CONTRIBUTING.rst index 47dffee..d71832a 100644 --- a/Source/kwsys/CONTRIBUTING.rst +++ b/Source/kwsys/CONTRIBUTING.rst @@ -1,28 +1,28 @@ Contributing to KWSys ********************* -Overview -======== +Patches +======= KWSys is kept in its own Git repository and shared by several projects via copies in their source trees. Changes to KWSys should not be made directly in a host project, except perhaps in maintenance branches. -Please visit - - http://public.kitware.com/Wiki/KWSys/Git +KWSys uses `Kitware's GitLab Instance`_ to manage development and code review. +To contribute patches: -to contribute changes directly to KWSys upstream. Once changes are -reviewed, tested, and integrated there then the copies of KWSys within -dependent projects can be updated to get the changes. +#. Fork the upstream `KWSys Repository`_ into a personal account. +#. Base all new work on the upstream ``master`` branch. +#. Run ``./SetupForDevelopment.sh`` in new local work trees. +#. Create commits making incremental, distinct, logically complete changes. +#. Push a topic branch to a personal repository fork on GitLab. +#. Create a GitLab Merge Request targeting the upstream ``master`` branch. -Issues -====== +Once changes are reviewed, tested, and integrated to KWSys upstream then +copies of KWSys within dependent projects can be updated to get the changes. -KWSys has no independent issue tracker. After encountering an issue -(bug) please try to submit a patch using the above instructions. -Otherwise please report the issue to the tracker for the project that -hosts the copy of KWSys in which the problem was found. +.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com +.. _`KWSys Repository`: https://gitlab.kitware.com/utils/kwsys Code Style ========== @@ -36,7 +36,6 @@ See also the `clang-format.bash`_ script. .. _`.clang-format`: .clang-format .. _`clang-format.bash`: clang-format.bash - License ======= diff --git a/Source/kwsys/README.rst b/Source/kwsys/README.rst new file mode 100644 index 0000000..fc6b590 --- /dev/null +++ b/Source/kwsys/README.rst @@ -0,0 +1,37 @@ +KWSys +***** + +Introduction +============ + +KWSys is the Kitware System Library. It provides platform-independent +APIs to many common system features that are implemented differently on +every platform. This library is intended to be shared among many +projects at the source level, so it has a configurable namespace. +Each project should configure KWSys to use a namespace unique to itself. +See comments in `CMakeLists.txt`_ for details. + +.. _`CMakeLists.txt`: CMakeLists.txt + +License +======= + +KWSys is distributed under the OSI-approved BSD 3-clause License. +See `Copyright.txt`_ for details. + +.. _`Copyright.txt`: Copyright.txt + +Reporting Bugs +============== + +KWSys has no independent issue tracker. After encountering an issue +(bug) please submit a patch using the instructions for `Contributing`_. +Otherwise please report the issue to the tracker for the project that +hosts the copy of KWSys in which the problem was found. + +Contributing +============ + +See `CONTRIBUTING.rst`_ for instructions to contribute. + +.. _`CONTRIBUTING.rst`: CONTRIBUTING.rst diff --git a/Source/kwsys/README.txt b/Source/kwsys/README.txt deleted file mode 100644 index b8191f7..0000000 --- a/Source/kwsys/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -KWSys provides a platform-independent API to many common system -features that are implemented differently on every platform. This -library is intended to be shared among many projects, so it has a -configurable namespace. Each project should configure KWSys to use a -namespace unique to itself. See comments in CMakeLists.txt for -details. - -You are probably reading this file in the source tree of a surrounding -project. In that case, see "../README.kwsys" for details of using -KWSys in your project. - -See CONTRIBUTING.rst for instructions to contribute KWSys changes. diff --git a/Utilities/Scripts/update-kwsys.bash b/Utilities/Scripts/update-kwsys.bash index 650841f..83da8a4 100755 --- a/Utilities/Scripts/update-kwsys.bash +++ b/Utilities/Scripts/update-kwsys.bash @@ -7,7 +7,7 @@ shopt -s dotglob readonly name="KWSys" readonly ownership="KWSys Upstream <kwrobot@kitware.com>" readonly subtree="Source/kwsys" -readonly repo="http://public.kitware.com/KWSys.git" +readonly repo="https://gitlab.kitware.com/utils/kwsys.git" readonly tag="master" readonly shortlog=true readonly paths=" |