https://github.com/Kitware/CMake
Revision ae80cb9f28c8c278a6897f331f65a1be77058897 authored by Brad King on 15 May 2014, 17:50:26 UTC, committed by Brad King on 15 May 2014, 18:01:16 UTC
Choose the attribute name and file type and send them through a single
attribute generation code path.  Compute the file extension only when
needed.  Leave the file type selection logic indented in a block so it
can be made conditional later.
1 parent 032961c
Raw File
Tip revision: ae80cb9f28c8c278a6897f331f65a1be77058897 authored by Brad King on 15 May 2014, 17:50:26 UTC
Xcode: Refactor internal source file type selection
Tip revision: ae80cb9
cmExternalMakefileProjectGenerator.h
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium

  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.

  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
#ifndef cmExternalMakefileProjectGenerator_h
#define cmExternalMakefileProjectGenerator_h

#include "cmStandardIncludes.h"

#include "cmDocumentation.h"

class cmGlobalGenerator;

/** \class cmExternalMakefileProjectGenerator
 * \brief Base class for generators for "External Makefile based IDE projects".
 *
 * cmExternalMakefileProjectGenerator is a base class for generators
 * for "external makefile based projects", i.e. IDE projects which work
 * an already existing makefiles.
 * See cmGlobalKdevelopGenerator as an example.
 * After the makefiles have been generated by one of the Makefile
 * generators, the Generate() method is called and this generator
 * can iterate over the local generators and/or projects to produce the
 * project files for the IDE.
 */
class cmExternalMakefileProjectGenerator
{
public:

  virtual ~cmExternalMakefileProjectGenerator() {}

  ///! Get the name for this generator.
  virtual std::string GetName() const = 0;
  /** Get the documentation entry for this generator.  */
  virtual void GetDocumentation(cmDocumentationEntry& entry,
                                const std::string& fullName) const = 0;
  virtual void EnableLanguage(std::vector<std::string> const& languages,
                              cmMakefile *, bool optional);

  ///! set the global generator which will generate the makefiles
  virtual void SetGlobalGenerator(cmGlobalGenerator* generator)
                                           {this->GlobalGenerator = generator;}

  ///! Return the list of global generators supported by this extra generator
  const std::vector<std::string>& GetSupportedGlobalGenerators() const
                                      {return this->SupportedGlobalGenerators;}

  ///! Get the name of the global generator for the given full name
  std::string GetGlobalGeneratorName(const std::string& fullName);
  /** Create a full name from the given global generator name and the
   * extra generator name
   */
  static std::string CreateFullGeneratorName(
                                            const std::string& globalGenerator,
                                            const std::string& extraGenerator);

  ///! Generate the project files, the Makefiles have already been generated
  virtual void Generate() = 0;
protected:
  ///! Contains the names of the global generators support by this generator.
  std::vector<std::string> SupportedGlobalGenerators;
  ///! the global generator which creates the makefiles
  const cmGlobalGenerator* GlobalGenerator;
};

#endif
back to top