cmGlobalKdevelopGenerator.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. Copyright (c) 2004 Alexander Neundorf, [email protected]. All rights reserved.
  9. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  10. This software is distributed WITHOUT ANY WARRANTY; without even
  11. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12. PURPOSE. See the above copyright notices for more information.
  13. =========================================================================*/
  14. #ifndef cmGlobalKdevelopGenerator_h
  15. #define cmGlobalKdevelopGenerator_h
  16. #include "cmGlobalUnixMakefileGenerator3.h"
  17. /** \class cmGlobalKdevelopGenerator
  18. * \brief Write Unix Makefiles accompanied by KDevelop3 project files.
  19. *
  20. * cmGlobalKdevelopGenerator produces a project file for KDevelop 3 (KDevelop
  21. * > 3.1.1). The project is based on the "Custom Makefile based C/C++"
  22. * project of KDevelop. Such a project consists of Unix Makefiles in the
  23. * build directory together with a <your_project>.kdevelop project file,
  24. * which contains the project settings and a <your_project>.kdevelop.filelist
  25. * file, which lists the source files relative to the kdevelop project
  26. * directory. The kdevelop project directory is the base source directory.
  27. */
  28. class cmGlobalKdevelopGenerator : public cmGlobalUnixMakefileGenerator3
  29. {
  30. public:
  31. cmGlobalKdevelopGenerator();
  32. static cmGlobalGenerator* New() { return new cmGlobalKdevelopGenerator; }
  33. ///! Get the name for the generator.
  34. virtual const char* GetName() const {
  35. return cmGlobalKdevelopGenerator::GetActualName();}
  36. static const char* GetActualName() {return "KDevelop3";}
  37. /** Get the documentation entry for this generator. */
  38. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  39. ///! Create a local generator appropriate to this Global Generator
  40. virtual cmLocalGenerator *CreateLocalGenerator();
  41. /**
  42. * Generate the all required files for building this project/tree. This
  43. * basically creates a series of LocalGenerators for each directory and
  44. * requests that they Generate.
  45. */
  46. 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.
  49. */
  50. bool CreateFilelistFile(cmLocalGenerator* lg,
  51. std::vector<cmLocalGenerator*>& lgs,
  52. const std::string& outputDir,
  53. const std::string& projectDirIn,
  54. const std::string& projectname,
  55. std::string& cmakeFilePattern,
  56. 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);
  69. /*** Reads the old foo.kdevelop line by line and only replaces the
  70. "important" lines
  71. */
  72. void MergeProjectFiles(const std::string& outputDir,
  73. const std::string& projectDir,
  74. const std::string& filename,
  75. const std::string& executable,
  76. const std::string& cmakeFilePattern,
  77. const std::string& fileToOpen,
  78. const std::string& sessionFilename);
  79. ///! Creates a new foo.kdevelop and a new foo.kdevses file
  80. void CreateNewProjectFile(const std::string& outputDir,
  81. const std::string& projectDir,
  82. const std::string& filename,
  83. const std::string& executable,
  84. const std::string& cmakeFilePattern,
  85. const std::string& fileToOpen,
  86. const std::string& sessionFilename);
  87. };
  88. #endif