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 605a85bd1cfb5601c9ec77cf9e45019f9faf23a2 (commit) via 19ffc0729fdc12b8c0874db7ae1c5e576b48ba10 (commit) from 48e27d6151459a671aa7611d298813eb9c2fedc3 (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=605a85bd1cfb5601c9ec77cf9e45019f9faf23a2 commit 605a85bd1cfb5601c9ec77cf9e45019f9faf23a2 Merge: 48e27d6 19ffc07 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Oct 13 08:47:45 2016 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Oct 13 08:47:45 2016 -0400 Merge topic 'st2-exclude-patterns-variable' into next 19ffc072 Sublime: Exclude build tree from source tree project only optionally https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19ffc0729fdc12b8c0874db7ae1c5e576b48ba10 commit 19ffc0729fdc12b8c0874db7ae1c5e576b48ba10 Author: Bruno Pedrosa <brup...@gmail.com> AuthorDate: Mon Oct 10 21:18:54 2016 +0200 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Oct 12 12:38:00 2016 -0400 Sublime: Exclude build tree from source tree project only optionally Create a `CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE` variable to control addition of the build tree to `folder_exclude_patterns` in the `.sublime-project`. Change the default of this behavior to OFF. Closes: #16351 diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index f76c467..064a9e3 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -159,6 +159,7 @@ Variables that Change Behavior /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY /variable/CMAKE_STAGING_PREFIX + /variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE /variable/CMAKE_SYSTEM_APPBUNDLE_PATH /variable/CMAKE_SYSTEM_FRAMEWORK_PATH /variable/CMAKE_SYSTEM_IGNORE_PATH diff --git a/Help/release/dev/st2-exclude-patterns-variable.rst b/Help/release/dev/st2-exclude-patterns-variable.rst new file mode 100644 index 0000000..8706c1f --- /dev/null +++ b/Help/release/dev/st2-exclude-patterns-variable.rst @@ -0,0 +1,7 @@ +st2-exclude-patterns-variable +----------------------------- + +* The :generator:`Sublime Text 2` extra generator no longer excludes the + build tree from the ``.sublime-project`` when it is inside the source tree. + The :variable:`CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE` variable + was added to control the behavior explicitly. diff --git a/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst new file mode 100644 index 0000000..d654425 --- /dev/null +++ b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst @@ -0,0 +1,7 @@ +CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE +--------------------------------------- + +If this variable evaluates to ``ON`` at the end of the top-level +``CMakeLists.txt`` file, the :generator:`Sublime Text 2` extra generator +excludes the build tree from the ``.sublime-project`` if it is inside the +source tree. diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 5ae969b..41f82a2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -55,10 +55,14 @@ cmExtraSublimeTextGenerator::GetFactory() cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator() : cmExternalMakefileProjectGenerator() { + this->ExcludeBuildFolder = false; } void cmExtraSublimeTextGenerator::Generate() { + this->ExcludeBuildFolder = this->GlobalGenerator->GlobalSettingIsOn( + "CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE"); + // for each sub project in the project create a sublime text 2 project for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator it = this->GlobalGenerator->GetProjectMap().begin(); @@ -84,6 +88,7 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile( const std::vector<cmLocalGenerator*>& lgs, const std::string& filename) { const cmMakefile* mf = lgs[0]->GetMakefile(); + cmGeneratedFileStream fout(filename.c_str()); if (!fout) { return; @@ -102,8 +107,10 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile( if ((!outputRelativeToSourceRoot.empty()) && ((outputRelativeToSourceRoot.length() < 3) || (outputRelativeToSourceRoot.substr(0, 3) != "../"))) { - fout << ",\n\t\t\t\"folder_exclude_patterns\": [\"" - << outputRelativeToSourceRoot << "\"]"; + if (this->ExcludeBuildFolder) { + fout << ",\n\t\t\t\"folder_exclude_patterns\": [\"" + << outputRelativeToSourceRoot << "\"]"; + } } } else { fout << "\t{\n\t\t\t\"path\": \"./\""; diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h index c917992..0c58221 100644 --- a/Source/cmExtraSublimeTextGenerator.h +++ b/Source/cmExtraSublimeTextGenerator.h @@ -64,6 +64,8 @@ private: std::string ComputeDefines(cmSourceFile* source, cmLocalGenerator* lg, cmGeneratorTarget* gtgt); + + bool ExcludeBuildFolder; }; #endif ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/release/dev/st2-exclude-patterns-variable.rst | 7 +++++++ Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst | 7 +++++++ Source/cmExtraSublimeTextGenerator.cxx | 11 +++++++++-- Source/cmExtraSublimeTextGenerator.h | 2 ++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/st2-exclude-patterns-variable.rst create mode 100644 Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits