2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2012-10-10 22:01:48 +00:00
|
|
|
#ifndef cmExtraSublimeTextGenerator_h
|
|
|
|
#define cmExtraSublimeTextGenerator_h
|
|
|
|
|
2016-09-01 18:59:28 +00:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2012-10-10 22:01:48 +00:00
|
|
|
#include "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
2016-09-01 18:59:28 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2012-10-10 22:01:48 +00:00
|
|
|
class cmGeneratedFileStream;
|
2012-11-11 20:07:49 +00:00
|
|
|
class cmGeneratorTarget;
|
2016-09-01 18:59:28 +00:00
|
|
|
class cmLocalGenerator;
|
|
|
|
class cmMakefile;
|
|
|
|
class cmSourceFile;
|
2012-10-10 22:01:48 +00:00
|
|
|
|
|
|
|
/** \class cmExtraSublimeTextGenerator
|
|
|
|
* \brief Write Sublime Text 2 project files for Makefile based projects
|
|
|
|
*/
|
|
|
|
class cmExtraSublimeTextGenerator : public cmExternalMakefileProjectGenerator
|
|
|
|
{
|
|
|
|
public:
|
2016-07-20 16:28:39 +00:00
|
|
|
static cmExternalMakefileProjectGeneratorFactory* GetFactory();
|
2012-11-11 20:07:49 +00:00
|
|
|
typedef std::map<std::string, std::vector<std::string> > MapSourceFileFlags;
|
2012-10-10 22:01:48 +00:00
|
|
|
cmExtraSublimeTextGenerator();
|
|
|
|
|
2016-06-27 19:25:27 +00:00
|
|
|
void Generate() CM_OVERRIDE;
|
2012-10-10 22:01:48 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
private:
|
2012-10-10 22:01:48 +00:00
|
|
|
void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
|
|
|
|
|
|
|
|
void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
|
2016-05-16 14:34:04 +00:00
|
|
|
const std::string& filename);
|
2013-02-06 18:31:44 +00:00
|
|
|
|
2012-10-11 20:53:40 +00:00
|
|
|
/** Appends all targets as build systems to the project file and get all
|
|
|
|
* include directories and compiler definitions used.
|
|
|
|
*/
|
|
|
|
void AppendAllTargets(const std::vector<cmLocalGenerator*>& lgs,
|
2016-05-16 14:34:04 +00:00
|
|
|
const cmMakefile* mf, cmGeneratedFileStream& fout,
|
2012-11-11 20:07:49 +00:00
|
|
|
MapSourceFileFlags& sourceFileFlags);
|
2012-10-13 10:54:51 +00:00
|
|
|
/** Returns the build command that needs to be executed to build the
|
|
|
|
* specified target.
|
|
|
|
*/
|
2012-10-10 22:01:48 +00:00
|
|
|
std::string BuildMakeCommand(const std::string& make, const char* makefile,
|
2014-02-06 22:31:47 +00:00
|
|
|
const std::string& target);
|
2012-10-13 10:54:51 +00:00
|
|
|
/** Appends the specified target to the generated project file as a Sublime
|
|
|
|
* Text build system.
|
|
|
|
*/
|
2016-05-16 14:34:04 +00:00
|
|
|
void AppendTarget(cmGeneratedFileStream& fout, const std::string& targetName,
|
|
|
|
cmLocalGenerator* lg, cmGeneratorTarget* target,
|
|
|
|
const char* make, const cmMakefile* makefile,
|
|
|
|
const char* compiler, MapSourceFileFlags& sourceFileFlags,
|
|
|
|
bool firstTarget);
|
2012-11-04 14:15:04 +00:00
|
|
|
/**
|
2012-11-11 20:07:49 +00:00
|
|
|
* Compute the flags for compilation of object files for a given @a language.
|
|
|
|
* @note Generally it is the value of the variable whose name is computed
|
|
|
|
* by LanguageFlagsVarName().
|
2012-11-04 14:15:04 +00:00
|
|
|
*/
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string ComputeFlagsForObject(cmSourceFile* source, cmLocalGenerator* lg,
|
2012-11-11 20:07:49 +00:00
|
|
|
cmGeneratorTarget* gtgt);
|
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
std::string ComputeDefines(cmSourceFile* source, cmLocalGenerator* lg,
|
2015-10-09 20:04:51 +00:00
|
|
|
cmGeneratorTarget* gtgt);
|
2016-10-10 19:18:54 +00:00
|
|
|
|
|
|
|
bool ExcludeBuildFolder;
|
2016-10-26 18:58:11 +00:00
|
|
|
std::string EnvSettings;
|
2012-10-10 22:01:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|