2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2007-08-01 17:18:50 +04:00
|
|
|
#ifndef cmExtraEclipseCDT4Generator_h
|
|
|
|
#define cmExtraEclipseCDT4Generator_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
#include "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <iosfwd>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class cmLocalGenerator;
|
2007-08-01 17:18:50 +04:00
|
|
|
class cmMakefile;
|
2016-03-31 11:52:43 +03:00
|
|
|
class cmSourceGroup;
|
2016-09-01 21:59:28 +03:00
|
|
|
class cmXMLWriter;
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
/** \class cmExtraEclipseCDT4Generator
|
|
|
|
* \brief Write Eclipse project files for Makefile based projects
|
|
|
|
*/
|
|
|
|
class cmExtraEclipseCDT4Generator : public cmExternalMakefileProjectGenerator
|
|
|
|
{
|
|
|
|
public:
|
2016-05-16 17:34:04 +03:00
|
|
|
enum LinkType
|
|
|
|
{
|
|
|
|
VirtualFolder,
|
|
|
|
LinkToFolder,
|
|
|
|
LinkToFile
|
|
|
|
};
|
2011-10-20 00:02:14 +04:00
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
cmExtraEclipseCDT4Generator();
|
|
|
|
|
2016-07-20 19:28:39 +03:00
|
|
|
static cmExternalMakefileProjectGeneratorFactory* GetFactory();
|
2007-08-01 17:18:50 +04:00
|
|
|
|
2016-06-27 22:25:27 +03:00
|
|
|
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
|
|
|
|
bool optional) CM_OVERRIDE;
|
2007-08-01 17:18:50 +04:00
|
|
|
|
2016-06-27 22:25:27 +03:00
|
|
|
void Generate() CM_OVERRIDE;
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
private:
|
2008-02-20 00:27:03 +03:00
|
|
|
// create .project file in the source tree
|
2011-11-19 14:01:03 +04:00
|
|
|
void CreateSourceProjectFile();
|
2008-02-20 00:27:03 +03:00
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
// create .project file
|
2008-02-20 00:27:03 +03:00
|
|
|
void CreateProjectFile();
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
// create .cproject file
|
|
|
|
void CreateCProjectFile() const;
|
|
|
|
|
|
|
|
// If built with cygwin cmake, convert posix to windows path.
|
2007-08-17 18:05:39 +04:00
|
|
|
static std::string GetEclipsePath(const std::string& path);
|
|
|
|
|
|
|
|
// Extract basename.
|
|
|
|
static std::string GetPathBasename(const std::string& path);
|
|
|
|
|
2008-02-19 23:07:28 +03:00
|
|
|
// Generate the project name as: <name>-<type>@<path>
|
|
|
|
static std::string GenerateProjectName(const std::string& name,
|
|
|
|
const std::string& type,
|
|
|
|
const std::string& path);
|
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
// Helper functions
|
2015-08-02 23:06:38 +03:00
|
|
|
static void AppendStorageScanners(cmXMLWriter& xml,
|
2009-01-10 02:58:21 +03:00
|
|
|
const cmMakefile& makefile);
|
2016-05-16 17:34:04 +03:00
|
|
|
static void AppendTarget(cmXMLWriter& xml, const std::string& target,
|
|
|
|
const std::string& make,
|
|
|
|
const std::string& makeArguments,
|
|
|
|
const std::string& path, const char* prefix = "",
|
2016-06-27 23:44:16 +03:00
|
|
|
const char* makeTarget = CM_NULLPTR);
|
2016-05-16 17:34:04 +03:00
|
|
|
static void AppendScannerProfile(
|
|
|
|
cmXMLWriter& xml, const std::string& profileID, bool openActionEnabled,
|
|
|
|
const std::string& openActionFilePath, bool pParserEnabled,
|
|
|
|
const std::string& scannerInfoProviderID,
|
|
|
|
const std::string& runActionArguments, const std::string& runActionCommand,
|
|
|
|
bool runActionUseDefault, bool sipParserEnabled);
|
|
|
|
|
|
|
|
static void AppendLinkedResource(cmXMLWriter& xml, const std::string& name,
|
|
|
|
const std::string& path, LinkType linkType);
|
|
|
|
|
|
|
|
static void AppendIncludeDirectories(
|
|
|
|
cmXMLWriter& xml, const std::vector<std::string>& includeDirs,
|
|
|
|
std::set<std::string>& emittedDirs);
|
2009-03-13 23:52:58 +03:00
|
|
|
|
2015-08-02 23:06:38 +03:00
|
|
|
static void AddEnvVar(std::ostream& out, const char* envVar,
|
2015-10-07 01:58:45 +03:00
|
|
|
cmLocalGenerator* lg);
|
2009-12-23 21:56:01 +03:00
|
|
|
|
2016-03-31 11:52:43 +03:00
|
|
|
void WriteGroups(std::vector<cmSourceGroup> const& sourceGroups,
|
|
|
|
std::string& linkName, cmXMLWriter& xml);
|
2015-08-02 23:06:38 +03:00
|
|
|
void CreateLinksToSubprojects(cmXMLWriter& xml, const std::string& baseDir);
|
|
|
|
void CreateLinksForTargets(cmXMLWriter& xml);
|
2011-10-23 13:00:45 +04:00
|
|
|
|
2008-02-20 00:27:03 +03:00
|
|
|
std::vector<std::string> SrcLinkedResources;
|
2013-08-29 22:46:17 +04:00
|
|
|
std::set<std::string> Natures;
|
2008-02-19 23:07:28 +03:00
|
|
|
std::string HomeDirectory;
|
|
|
|
std::string HomeOutputDirectory;
|
2008-02-20 00:27:03 +03:00
|
|
|
bool IsOutOfSourceBuild;
|
|
|
|
bool GenerateSourceProject;
|
2012-10-18 01:45:02 +04:00
|
|
|
bool GenerateLinkedResources;
|
2011-10-15 21:40:21 +04:00
|
|
|
bool SupportsVirtualFolders;
|
2013-03-23 02:50:38 +04:00
|
|
|
bool SupportsGmakeErrorParser;
|
2014-01-01 20:52:57 +04:00
|
|
|
bool SupportsMachO64Parser;
|
2016-02-25 00:13:04 +03:00
|
|
|
bool CEnabled;
|
|
|
|
bool CXXEnabled;
|
2007-08-01 17:18:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|