summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraSublimeTextGenerator.cxx
diff options
context:
space:
mode:
authorMorné Chamberlain <thefreeman.za@gmail.com>2012-10-13 09:20:09 (GMT)
committerMorné Chamberlain <thefreeman.za@gmail.com>2012-10-13 09:20:09 (GMT)
commitef8aa081a164817d1d78b6df8ebcf23e421d422f (patch)
tree98db182e2e46f75af372887c4b56f725290c6650 /Source/cmExtraSublimeTextGenerator.cxx
parent4d585b109d5f5984d285a82c5582f9b585e9792b (diff)
downloadCMake-ef8aa081a164817d1d78b6df8ebcf23e421d422f.zip
CMake-ef8aa081a164817d1d78b6df8ebcf23e421d422f.tar.gz
CMake-ef8aa081a164817d1d78b6df8ebcf23e421d422f.tar.bz2
Fixed support for the Ninja build system.
Diffstat (limited to 'Source/cmExtraSublimeTextGenerator.cxx')
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx41
1 files changed, 31 insertions, 10 deletions
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 6a95aa3..1338241 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -29,7 +29,12 @@
# define PATH_SEP "/"
#endif
-/* Some useful URLs:
+/*
+Sublime Text 2 Generator
+Author: Morné Chamberlain
+This generator was initially based off of the CodeBlocks generator.
+
+Some useful URLs:
Homepage:
http://www.sublimetext.com/
@@ -257,7 +262,6 @@ void cmExtraSublimeTextGenerator::
std::stringstream& fileIncludePatternsStream,
std::set<std::string>& folderIncludePatternsSet)
{
- // Convert
const char* cmakeRoot = mf->GetDefinition("CMAKE_ROOT");
for (std::vector<std::string>::const_iterator jt = allFiles.begin();
jt != allFiles.end();
@@ -481,8 +485,17 @@ void cmExtraSublimeTextGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
// Write out the build_system data for this target
- std::string makefileName = makefile->GetStartOutputDirectory();
- makefileName += "/Makefile";
+ std::string makefileName = makefile->GetHomeOutputDirectory();
+ // Ninja uses ninja.build files (look for a way to get the output file name
+ // from cmMakefile)
+ if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
+ {
+ makefileName += "/build.ninja";
+ }
+ else
+ {
+ makefileName += "/Makefile";
+ }
if (!firstTarget)
{
fout << ",\n\t";
@@ -513,20 +526,28 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
command += target;
command += "\"";
}
- else if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
+ else if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
{
- // no escaping of spaces in this case, see
- // http://public.kitware.com/Bug/view.php?id=10014
- std::string makefileName = makefile;
+ std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += ", \"-f\", \"";
command += makefileName + "\"";
- command += ", \"VERBOSE=1\", \"";
+ command += ", \"-v\", \"";
command += target;
command += "\"";
}
else
{
- std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
+ std::string makefileName;
+ if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
+ {
+ // no escaping of spaces in this case, see
+ // http://public.kitware.com/Bug/view.php?id=10014
+ makefileName = makefile;
+ }
+ else
+ {
+ makefileName = cmSystemTools::ConvertToOutputPath(makefile);
+ }
command += ", \"-f\", \"";
command += makefileName + "\"";
command += ", \"VERBOSE=1\", \"";