2007-08-01 17:18:50 +04:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
Copyright (c) 2004 Alexander Neundorf, neundorf@kde.org. All rights reserved.
|
|
|
|
Copyright (c) 2007 Miguel A. Figueroa-Villanueva. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#ifndef cmExtraEclipseCDT4Generator_h
|
|
|
|
#define cmExtraEclipseCDT4Generator_h
|
|
|
|
|
|
|
|
#include "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
|
|
|
class cmMakefile;
|
|
|
|
class cmGeneratedFileStream;
|
|
|
|
|
|
|
|
/** \class cmExtraEclipseCDT4Generator
|
|
|
|
* \brief Write Eclipse project files for Makefile based projects
|
|
|
|
*
|
|
|
|
* This generator is in early alpha stage.
|
|
|
|
*/
|
|
|
|
class cmExtraEclipseCDT4Generator : public cmExternalMakefileProjectGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmExtraEclipseCDT4Generator();
|
|
|
|
|
|
|
|
static cmExternalMakefileProjectGenerator* New() {
|
|
|
|
return new cmExtraEclipseCDT4Generator;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual const char* GetName() const {
|
|
|
|
return cmExtraEclipseCDT4Generator::GetActualName();
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char* GetActualName() { return "Eclipse CDT4"; }
|
|
|
|
|
|
|
|
virtual void GetDocumentation(cmDocumentationEntry& entry,
|
|
|
|
const char* fullName) const;
|
|
|
|
|
|
|
|
virtual void SetGlobalGenerator(cmGlobalGenerator* generator);
|
|
|
|
|
|
|
|
virtual void Generate();
|
|
|
|
|
|
|
|
private:
|
2008-02-20 00:27:03 +03:00
|
|
|
// create .project file in the source tree
|
|
|
|
void CreateSourceProjectFile() const;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
// Eclipse supported toolchain types
|
|
|
|
enum EclipseToolchainType
|
|
|
|
{
|
|
|
|
EclipseToolchainOther,
|
|
|
|
EclipseToolchainLinux,
|
|
|
|
EclipseToolchainCygwin,
|
|
|
|
EclipseToolchainMinGW,
|
|
|
|
EclipseToolchainSolaris,
|
|
|
|
EclipseToolchainMacOSX
|
|
|
|
};
|
2007-08-17 18:05:39 +04:00
|
|
|
static EclipseToolchainType GetToolChainType(const cmMakefile& makefile);
|
2007-08-01 17:18:50 +04:00
|
|
|
|
|
|
|
// 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
|
2009-01-10 02:58:21 +03:00
|
|
|
static void AppendStorageScanners(cmGeneratedFileStream& fout,
|
|
|
|
const cmMakefile& makefile);
|
2007-08-17 18:05:39 +04:00
|
|
|
static void AppendTarget (cmGeneratedFileStream& fout,
|
|
|
|
const std::string& target,
|
|
|
|
const std::string& make);
|
|
|
|
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,
|
|
|
|
const std::string& path);
|
|
|
|
|
2009-01-11 20:18:44 +03:00
|
|
|
bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
|
|
|
|
const std::string& defname,
|
|
|
|
const std::string& altdefname);
|
|
|
|
|
2008-02-20 00:27:03 +03:00
|
|
|
std::vector<std::string> SrcLinkedResources;
|
|
|
|
std::vector<std::string> OutLinkedResources;
|
2008-02-19 23:07:28 +03:00
|
|
|
std::string HomeDirectory;
|
|
|
|
std::string HomeOutputDirectory;
|
2009-01-10 04:35:21 +03:00
|
|
|
std::set<std::string> TargetsToIgnore;
|
2008-02-20 00:27:03 +03:00
|
|
|
bool IsOutOfSourceBuild;
|
|
|
|
bool GenerateSourceProject;
|
2008-02-19 23:07:28 +03:00
|
|
|
|
2007-08-01 17:18:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|