You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.4 KiB

  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, neundorf@kde.org. 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 "cmExternalMakefileProjectGenerator.h"
  17. class cmLocalGenerator;
  18. /** \class cmGlobalKdevelopGenerator
  19. * \brief Write Unix Makefiles accompanied by KDevelop3 project files.
  20. *
  21. * cmGlobalKdevelopGenerator produces a project file for KDevelop 3 (KDevelop
  22. * > 3.1.1). The project is based on the "Custom Makefile based C/C++"
  23. * project of KDevelop. Such a project consists of Unix Makefiles in the
  24. * build directory together with a <your_project>.kdevelop project file,
  25. * which contains the project settings and a <your_project>.kdevelop.filelist
  26. * file, which lists the source files relative to the kdevelop project
  27. * directory. The kdevelop project directory is the base source directory.
  28. */
  29. class cmGlobalKdevelopGenerator : public cmExternalMakefileProjectGenerator
  30. {
  31. public:
  32. cmGlobalKdevelopGenerator();
  33. virtual void SetGlobalGenerator(cmGlobalGenerator* generator);
  34. virtual const char* GetName() const
  35. { return cmGlobalKdevelopGenerator::GetActualName();}
  36. static const char* GetActualName() { return "KDevelop3";}
  37. static cmExternalMakefileProjectGenerator* New()
  38. { return new cmGlobalKdevelopGenerator; }
  39. /** Get the documentation entry for this generator. */
  40. virtual void GetDocumentation(cmDocumentationEntry& entry,
  41. const char* fullName) const;
  42. virtual void Generate();
  43. private:
  44. /*** Create the foo.kdevelop.filelist file, return false if it doesn't
  45. succeed. If the file already exists the contents will be merged.
  46. */
  47. bool CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs,
  48. const std::string& outputDir,
  49. const std::string& projectDirIn,
  50. const std::string& projectname,
  51. std::string& cmakeFilePattern,
  52. std::string& fileToOpen);
  53. /** Create the foo.kdevelop file. This one calls MergeProjectFiles()
  54. if it already exists, otherwise createNewProjectFile() The project
  55. files will be created in \a outputDir (in the build tree), the
  56. kdevelop project dir will be set to \a projectDir (in the source
  57. tree). \a cmakeFilePattern consists of a lists of all cmake
  58. listfiles used by this CMakeLists.txt */
  59. void CreateProjectFile(const std::string& outputDir,
  60. const std::string& projectDir,
  61. const std::string& projectname,
  62. const std::string& executable,
  63. const std::string& cmakeFilePattern,
  64. const std::string& fileToOpen);
  65. /*** Reads the old foo.kdevelop line by line and only replaces the
  66. "important" lines
  67. */
  68. void MergeProjectFiles(const std::string& outputDir,
  69. const std::string& projectDir,
  70. const std::string& filename,
  71. const std::string& executable,
  72. const std::string& cmakeFilePattern,
  73. const std::string& fileToOpen,
  74. const std::string& sessionFilename);
  75. ///! Creates a new foo.kdevelop and a new foo.kdevses 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. const std::string& fileToOpen,
  82. const std::string& sessionFilename);
  83. std::vector<std::string> Blacklist;
  84. };
  85. #endif