summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.h
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-01 13:18:50 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-01 13:18:50 (GMT)
commitf7f522e61a32c93c86ee455d8c465d8e7e52ae5a (patch)
treef8808c7b68ee0ad42e5e465f419d1becd9940348 /Source/cmExtraEclipseCDT4Generator.h
parent21f73ebc363a6819ed387c6e5c2fd784db81014a (diff)
downloadCMake-f7f522e61a32c93c86ee455d8c465d8e7e52ae5a.zip
CMake-f7f522e61a32c93c86ee455d8c465d8e7e52ae5a.tar.gz
CMake-f7f522e61a32c93c86ee455d8c465d8e7e52ae5a.tar.bz2
ENH: add Eclipse CDT4 generator, patch from Miguel A. Figueroa-Villanueva
Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.h')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
new file mode 100644
index 0000000..17fd10d
--- /dev/null
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -0,0 +1,93 @@
+/*=========================================================================
+
+ 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:
+ // create .project file
+ void CreateProjectFile() const;
+
+ // create .cproject file
+ void CreateCProjectFile() const;
+
+ // Eclipse supported toolchain types
+ enum EclipseToolchainType
+ {
+ EclipseToolchainOther,
+ EclipseToolchainLinux,
+ EclipseToolchainCygwin,
+ EclipseToolchainMinGW,
+ EclipseToolchainSolaris,
+ EclipseToolchainMacOSX
+ };
+ EclipseToolchainType GetToolChainType(const cmMakefile& makefile) const;
+
+ // If built with cygwin cmake, convert posix to windows path.
+ std::string GetEclipsePath(const std::string& path) const;
+
+ // Helper functions
+ void AppendStorageScanners(cmGeneratedFileStream& fout,
+ const cmMakefile& makefile) const;
+ void AppendTarget (cmGeneratedFileStream& fout,
+ const std::string& target) const;
+ 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) const;
+};
+
+#endif