1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmExtraEclipseCDT4Generator.h,v $
6 Date: $Date: 2008-02-19 21:27:03 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 Copyright (c) 2004 Alexander Neundorf, neundorf@kde.org. All rights reserved.
11 Copyright (c) 2007 Miguel A. Figueroa-Villanueva. All rights reserved.
12 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notices for more information.
18 =========================================================================*/
19 #ifndef cmExtraEclipseCDT4Generator_h
20 #define cmExtraEclipseCDT4Generator_h
22 #include "cmExternalMakefileProjectGenerator.h"
25 class cmGeneratedFileStream
;
27 /** \class cmExtraEclipseCDT4Generator
28 * \brief Write Eclipse project files for Makefile based projects
30 * This generator is in early alpha stage.
32 class cmExtraEclipseCDT4Generator
: public cmExternalMakefileProjectGenerator
35 cmExtraEclipseCDT4Generator();
37 static cmExternalMakefileProjectGenerator
* New() {
38 return new cmExtraEclipseCDT4Generator
;
41 virtual const char* GetName() const {
42 return cmExtraEclipseCDT4Generator::GetActualName();
45 static const char* GetActualName() { return "Eclipse CDT4"; }
47 virtual void GetDocumentation(cmDocumentationEntry
& entry
,
48 const char* fullName
) const;
50 virtual void SetGlobalGenerator(cmGlobalGenerator
* generator
);
52 virtual void Generate();
55 // create .project file in the source tree
56 void CreateSourceProjectFile() const;
58 // create .project file
59 void CreateProjectFile();
61 // create .cproject file
62 void CreateCProjectFile() const;
64 // Eclipse supported toolchain types
65 enum EclipseToolchainType
67 EclipseToolchainOther
,
68 EclipseToolchainLinux
,
69 EclipseToolchainCygwin
,
70 EclipseToolchainMinGW
,
71 EclipseToolchainSolaris
,
72 EclipseToolchainMacOSX
74 static EclipseToolchainType
GetToolChainType(const cmMakefile
& makefile
);
76 // If built with cygwin cmake, convert posix to windows path.
77 static std::string
GetEclipsePath(const std::string
& path
);
80 static std::string
GetPathBasename(const std::string
& path
);
82 // Generate the project name as: <name>-<type>@<path>
83 static std::string
GenerateProjectName(const std::string
& name
,
84 const std::string
& type
,
85 const std::string
& path
);
88 static void AppendStorageScanners(cmGeneratedFileStream
& fout
);
89 static void AppendTarget (cmGeneratedFileStream
& fout
,
90 const std::string
& target
,
91 const std::string
& make
);
92 static void AppendScannerProfile (cmGeneratedFileStream
& fout
,
93 const std::string
& profileID
,
94 bool openActionEnabled
,
95 const std::string
& openActionFilePath
,
97 const std::string
& scannerInfoProviderID
,
98 const std::string
& runActionArguments
,
99 const std::string
& runActionCommand
,
100 bool runActionUseDefault
,
101 bool sipParserEnabled
);
103 static void AppendLinkedResource (cmGeneratedFileStream
& fout
,
104 const std::string
& name
,
105 const std::string
& path
);
107 std::vector
<std::string
> SrcLinkedResources
;
108 std::vector
<std::string
> OutLinkedResources
;
109 std::string HomeDirectory
;
110 std::string HomeOutputDirectory
;
111 bool IsOutOfSourceBuild
;
112 bool GenerateSourceProject
;