1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2004-2009 Kitware, Inc.
4 Copyright 2004 Alexander Neundorf (neundorf@kde.org)
6 Distributed under the OSI-approved BSD License (the "License");
7 see accompanying file Copyright.txt for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even the
10 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 See the License for more information.
12 ============================================================================*/
13 #ifndef cmGlobalKdevelopGenerator_h
14 #define cmGlobalKdevelopGenerator_h
16 #include "cmExternalMakefileProjectGenerator.h"
18 class cmLocalGenerator;
20 /** \class cmGlobalKdevelopGenerator
21 * \brief Write Unix Makefiles accompanied by KDevelop3 project files.
23 * cmGlobalKdevelopGenerator produces a project file for KDevelop 3 (KDevelop
24 * > 3.1.1). The project is based on the "Custom Makefile based C/C++"
25 * project of KDevelop. Such a project consists of Unix Makefiles in the
26 * build directory together with a \<your_project\>.kdevelop project file,
27 * which contains the project settings and a \<your_project\>.kdevelop.filelist
28 * file, which lists the source files relative to the kdevelop project
29 * directory. The kdevelop project directory is the base source directory.
31 class cmGlobalKdevelopGenerator : public cmExternalMakefileProjectGenerator
34 cmGlobalKdevelopGenerator();
36 virtual const char* GetName() const
37 { return cmGlobalKdevelopGenerator::GetActualName();}
38 static const char* GetActualName() { return "KDevelop3";}
39 static cmExternalMakefileProjectGenerator* New()
40 { return new cmGlobalKdevelopGenerator; }
41 /** Get the documentation entry for this generator. */
42 virtual void GetDocumentation(cmDocumentationEntry& entry,
43 const char* fullName) const;
45 virtual void Generate();
47 /*** Create the foo.kdevelop.filelist file, return false if it doesn't
48 succeed. If the file already exists the contents will be merged.
50 bool CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs,
51 const std::string& outputDir,
52 const std::string& projectDirIn,
53 const std::string& projectname,
54 std::string& cmakeFilePattern,
55 std::string& fileToOpen);
57 /** Create the foo.kdevelop file. This one calls MergeProjectFiles()
58 if it already exists, otherwise createNewProjectFile() The project
59 files will be created in \a outputDir (in the build tree), the
60 kdevelop project dir will be set to \a projectDir (in the source
61 tree). \a cmakeFilePattern consists of a lists of all cmake
62 listfiles used by this CMakeLists.txt */
63 void CreateProjectFile(const std::string& outputDir,
64 const std::string& projectDir,
65 const std::string& projectname,
66 const std::string& executable,
67 const std::string& cmakeFilePattern,
68 const std::string& fileToOpen);
70 /*** Reads the old foo.kdevelop line by line and only replaces the
73 void MergeProjectFiles(const std::string& outputDir,
74 const std::string& projectDir,
75 const std::string& filename,
76 const std::string& executable,
77 const std::string& cmakeFilePattern,
78 const std::string& fileToOpen,
79 const std::string& sessionFilename);
80 ///! Creates a new foo.kdevelop and a new foo.kdevses file
81 void CreateNewProjectFile(const std::string& outputDir,
82 const std::string& projectDir,
83 const std::string& filename,
84 const std::string& executable,
85 const std::string& cmakeFilePattern,
86 const std::string& fileToOpen,
87 const std::string& sessionFilename);
89 std::vector<std::string> Blacklist;