diff options
author | Brad King <brad.king@kitware.com> | 2016-10-14 13:02:45 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-14 13:02:45 (GMT) |
commit | 8b496672fe0ae641bcb45aec04094db9987732bb (patch) | |
tree | 49025c0368d27acaaeae29b8ea31eeeba8e9542b /Source | |
parent | dabd17792215535bdbc0fc5ad032e2a59e7505d2 (diff) | |
parent | 19ffc0729fdc12b8c0874db7ae1c5e576b48ba10 (diff) | |
download | CMake-8b496672fe0ae641bcb45aec04094db9987732bb.zip CMake-8b496672fe0ae641bcb45aec04094db9987732bb.tar.gz CMake-8b496672fe0ae641bcb45aec04094db9987732bb.tar.bz2 |
Merge topic 'st2-exclude-patterns-variable'
19ffc072 Sublime: Exclude build tree from source tree project only optionally
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraSublimeTextGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmExtraSublimeTextGenerator.h | 2 |
2 files changed, 11 insertions, 2 deletions
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 |