cmake/Source/cmExtraEclipseCDT4Generator.h

123 lines
4.1 KiB
C
Raw Normal View History

2009-10-04 10:30:41 +03:00
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2004-2009 Kitware, Inc.
Copyright 2004 Alexander Neundorf (neundorf@kde.org)
Copyright 2007 Miguel A. Figueroa-Villanueva
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmExtraEclipseCDT4Generator_h
#define cmExtraEclipseCDT4Generator_h
#include "cmExternalMakefileProjectGenerator.h"
class cmMakefile;
2016-07-09 11:21:54 +02:00
class cmXMLWriter;
class cmSourceGroup;
/** \class cmExtraEclipseCDT4Generator
* \brief Write Eclipse project files for Makefile based projects
*/
class cmExtraEclipseCDT4Generator : public cmExternalMakefileProjectGenerator
{
public:
2016-07-09 11:21:54 +02:00
enum LinkType
{
VirtualFolder,
LinkToFolder,
LinkToFile
};
2012-02-18 12:40:36 +02:00
cmExtraEclipseCDT4Generator();
2016-07-09 11:21:54 +02:00
static cmExternalMakefileProjectGenerator* New()
{
return new cmExtraEclipseCDT4Generator;
}
2016-07-09 11:21:54 +02:00
virtual std::string GetName() const
{
return cmExtraEclipseCDT4Generator::GetActualName();
}
2015-04-27 22:25:09 +02:00
static std::string GetActualName() { return "Eclipse CDT4"; }
virtual void GetDocumentation(cmDocumentationEntry& entry,
2016-07-09 11:21:54 +02:00
const std::string& fullName) const;
2014-08-03 19:52:23 +02:00
virtual void EnableLanguage(std::vector<std::string> const& languages,
2016-07-09 11:21:54 +02:00
cmMakefile*, bool optional);
virtual void Generate();
private:
// create .project file in the source tree
2012-02-18 12:40:36 +02:00
void CreateSourceProjectFile();
// create .project file
void CreateProjectFile();
// create .cproject file
void CreateCProjectFile() const;
// If built with cygwin cmake, convert posix to windows path.
static std::string GetEclipsePath(const std::string& path);
// Extract basename.
static std::string GetPathBasename(const std::string& path);
// Generate the project name as: <name>-<type>@<path>
static std::string GenerateProjectName(const std::string& name,
const std::string& type,
const std::string& path);
// Helper functions
2016-07-09 11:21:54 +02:00
static void AppendStorageScanners(cmXMLWriter& xml,
const cmMakefile& makefile);
2016-07-09 11:21:54 +02: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 = "",
const char* makeTarget = NULL);
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);
static void AddEnvVar(std::ostream& out, const char* envVar,
2016-03-13 13:35:51 +01:00
cmLocalGenerator* lg);
2010-03-17 14:00:29 +02:00
2016-07-09 11:21:54 +02:00
void WriteGroups(std::vector<cmSourceGroup> const& sourceGroups,
std::string& linkName, cmXMLWriter& xml);
void CreateLinksToSubprojects(cmXMLWriter& xml, const std::string& baseDir);
void CreateLinksForTargets(cmXMLWriter& xml);
2012-02-18 12:40:36 +02:00
std::vector<std::string> SrcLinkedResources;
2014-08-03 19:52:23 +02:00
std::set<std::string> Natures;
std::string HomeDirectory;
std::string HomeOutputDirectory;
bool IsOutOfSourceBuild;
bool GenerateSourceProject;
2013-03-16 19:13:01 +02:00
bool GenerateLinkedResources;
2012-02-18 12:40:36 +02:00
bool SupportsVirtualFolders;
2013-11-03 12:27:13 +02:00
bool SupportsGmakeErrorParser;
2014-08-03 19:52:23 +02:00
bool SupportsMachO64Parser;
2016-07-09 11:21:54 +02:00
bool CEnabled;
bool CXXEnabled;
};
#endif