cmGlobalKdevelopGenerator.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 "cmGlobalUnixMakefileGenerator.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 > 3.1.1).
  21. * The project is based on the "Custom Makefile based C/C++" project of KDevelop.
  22. * Such a project consists of Unix Makefiles in the build directory together
  23. * with a <your_project>.kdevelop project file, which contains the project settings
  24. * and a <your_project>.kdevelop.filelist file, which lists the source files relative
  25. * to the kdevelop project directory. The kdevelop project directory is the base
  26. * source directory.
  27. */
  28. class cmGlobalKdevelopGenerator : public cmGlobalUnixMakefileGenerator
  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. /** Create the foo.kdevelop file. This one calls MergeProjectFiles()
  57. if it already exists, otherwise createNewProjectFile() The project
  58. files will be created in \a outputDir (in the build tree), the
  59. kdevelop project dir will be set to \a projectDir (in the source
  60. tree). \a cmakeFilePattern consists of a lists of all cmake
  61. listfiles used by this CMakeLists.txt */
  62. void CreateProjectFile(const std::string& outputDir,
  63. const std::string& projectDir,
  64. const std::string& projectname,
  65. const std::string& executable,
  66. const std::string& cmakeFilePattern);
  67. /*** Reads the old foo.kdevelop line by line and only replaces the
  68. "important" lines
  69. */
  70. void MergeProjectFiles(const std::string& outputDir,
  71. const std::string& projectDir,
  72. const std::string& filename,
  73. const std::string& executable,
  74. const std::string& cmakeFilePattern);
  75. ///! Creates a new foo.kdevelop file
  76. void CreateNewProjectFile(const std::string& outputDir,
  77. const std::string& projectDir,
  78. const std::string& filename,
  79. const std::string& executable,
  80. const std::string& cmakeFilePattern);
  81. };
  82. #endif