2009-09-28 19:43:28 +04: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.
|
|
|
|
============================================================================*/
|
2007-08-01 17:18:50 +04:00
|
|
|
#ifndef cmExtraEclipseCDT4Generator_h
|
|
|
|
#define cmExtraEclipseCDT4Generator_h
|
|
|
|
|
|
|
|
#include "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
|
|
|
class cmMakefile;
|
|
|
|
class cmGeneratedFileStream;
|
|
|
|
|
|
|
|
/** \class cmExtraEclipseCDT4Generator
|
|
|
|
* \brief Write Eclipse project files for Makefile based projects
|
|
|
|
*/
|
|
|
|
class cmExtraEclipseCDT4Generator : public cmExternalMakefileProjectGenerator
|
|
|
|
{
|
|
|
|
public:
|
2011-10-20 00:02:14 +04:00
|
|
|
enum LinkType {VirtualFolder, LinkToFolder, LinkToFile };
|
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
cmExtraEclipseCDT4Generator();
|
|
|
|
|
|
|
|
static cmExternalMakefileProjectGenerator* New() {
|
|
|
|
return new cmExtraEclipseCDT4Generator;
|
|
|
|
}
|
|
|
|
|
2014-02-25 02:36:27 +04:00
|
|
|
virtual std::string GetName() const {
|
2007-08-01 17:18:50 +04:00
|
|
|
return cmExtraEclipseCDT4Generator::GetActualName();
|
|
|
|
}
|
|
|
|
|
2014-02-25 02:36:27 +04:00
|
|
|
static std::string GetActualName() { return "Eclipse CDT4"; }
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
virtual void GetDocumentation(cmDocumentationEntry& entry,
|
2014-02-25 02:36:27 +04:00
|
|
|
const std::string& fullName) const;
|
2013-08-29 22:46:17 +04:00
|
|
|
virtual void EnableLanguage(std::vector<std::string> const& languages,
|
|
|
|
cmMakefile *, bool optional);
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
virtual void Generate();
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2009-01-09 02:09:50 +03:00
|
|
|
static std::string EscapeForXML(const std::string& value);
|
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
// Helper functions
|
2010-11-12 00:02:07 +03:00
|
|
|
static void AppendStorageScanners(cmGeneratedFileStream& fout,
|
2009-01-10 02:58:21 +03:00
|
|
|
const cmMakefile& makefile);
|
2007-08-17 18:05:39 +04:00
|
|
|
static void AppendTarget (cmGeneratedFileStream& fout,
|
|
|
|
const std::string& target,
|
2009-09-17 02:01:23 +04:00
|
|
|
const std::string& make,
|
2010-12-12 18:52:20 +03:00
|
|
|
const std::string& makeArguments,
|
2009-09-17 02:01:23 +04:00
|
|
|
const std::string& path,
|
2011-10-23 14:25:33 +04:00
|
|
|
const char* prefix = "",
|
|
|
|
const char* makeTarget = NULL);
|
2007-08-17 18:05:39 +04:00
|
|
|
static void AppendScannerProfile (cmGeneratedFileStream& fout,
|
|
|
|
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);
|
2008-02-19 23:07:28 +03:00
|
|
|
|
2008-02-20 00:27:03 +03:00
|
|
|
static void AppendLinkedResource (cmGeneratedFileStream& fout,
|
|
|
|
const std::string& name,
|
2011-05-07 00:44:45 +04:00
|
|
|
const std::string& path,
|
2011-10-20 00:02:14 +04:00
|
|
|
LinkType linkType);
|
2008-02-20 00:27:03 +03:00
|
|
|
|
2009-03-13 23:52:58 +03:00
|
|
|
static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
|
|
|
|
const std::vector<std::string>& includeDirs,
|
|
|
|
std::set<std::string>& emittedDirs);
|
|
|
|
|
2010-11-12 00:02:07 +03:00
|
|
|
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
|
2015-10-07 01:58:45 +03:00
|
|
|
cmLocalGenerator* lg);
|
2009-12-23 21:56:01 +03:00
|
|
|
|
2011-11-19 14:01:03 +04:00
|
|
|
void CreateLinksToSubprojects(cmGeneratedFileStream& fout,
|
|
|
|
const std::string& baseDir);
|
2011-10-23 14:22:20 +04:00
|
|
|
void CreateLinksForTargets(cmGeneratedFileStream& fout);
|
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;
|
2008-02-19 23:07:28 +03:00
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|