2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2007-06-08 19:57:16 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2007-06-08 19:57:16 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
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.
|
|
|
|
============================================================================*/
|
2007-06-08 19:57:16 +04:00
|
|
|
#ifndef cmExternalMakefileProjectGenerator_h
|
|
|
|
#define cmExternalMakefileProjectGenerator_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2016-09-01 21:05:48 +03:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
class cmGlobalGenerator;
|
2016-09-01 21:59:28 +03:00
|
|
|
class cmMakefile;
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
/** \class cmExternalMakefileProjectGenerator
|
|
|
|
* \brief Base class for generators for "External Makefile based IDE projects".
|
|
|
|
*
|
|
|
|
* cmExternalMakefileProjectGenerator is a base class for generators
|
2012-08-13 21:42:58 +04:00
|
|
|
* for "external makefile based projects", i.e. IDE projects which work
|
2007-06-08 19:57:16 +04:00
|
|
|
* an already existing makefiles.
|
|
|
|
* See cmGlobalKdevelopGenerator as an example.
|
2012-08-13 21:42:58 +04:00
|
|
|
* After the makefiles have been generated by one of the Makefile
|
2007-06-08 19:57:16 +04:00
|
|
|
* generators, the Generate() method is called and this generator
|
2012-08-13 21:42:58 +04:00
|
|
|
* can iterate over the local generators and/or projects to produce the
|
2007-06-08 19:57:16 +04:00
|
|
|
* project files for the IDE.
|
|
|
|
*/
|
|
|
|
class cmExternalMakefileProjectGenerator
|
|
|
|
{
|
|
|
|
public:
|
2007-06-08 20:42:29 +04:00
|
|
|
virtual ~cmExternalMakefileProjectGenerator() {}
|
|
|
|
|
2013-08-29 22:43:54 +04:00
|
|
|
virtual void EnableLanguage(std::vector<std::string> const& languages,
|
2016-05-16 17:34:04 +03:00
|
|
|
cmMakefile*, bool optional);
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
///! set the global generator which will generate the makefiles
|
|
|
|
virtual void SetGlobalGenerator(cmGlobalGenerator* generator)
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
this->GlobalGenerator = generator;
|
|
|
|
}
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
///! Return the list of global generators supported by this extra generator
|
2012-08-13 21:42:58 +04:00
|
|
|
const std::vector<std::string>& GetSupportedGlobalGenerators() const
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
return this->SupportedGlobalGenerators;
|
|
|
|
}
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
/** Create a full name from the given global generator name and the
|
|
|
|
* extra generator name
|
|
|
|
*/
|
2014-02-25 02:36:27 +04:00
|
|
|
static std::string CreateFullGeneratorName(
|
2016-05-16 17:34:04 +03:00
|
|
|
const std::string& globalGenerator, const std::string& extraGenerator);
|
2007-06-08 19:57:16 +04:00
|
|
|
|
|
|
|
///! Generate the project files, the Makefiles have already been generated
|
|
|
|
virtual void Generate() = 0;
|
2016-05-16 17:34:04 +03:00
|
|
|
|
2016-07-20 19:28:39 +03:00
|
|
|
void SetName(const std::string& n) { Name = n; }
|
|
|
|
std::string GetName() const { return Name; }
|
|
|
|
|
2007-06-08 19:57:16 +04:00
|
|
|
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;
|
2016-07-20 19:28:39 +03:00
|
|
|
|
|
|
|
std::string Name;
|
|
|
|
};
|
|
|
|
|
|
|
|
class cmExternalMakefileProjectGeneratorFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmExternalMakefileProjectGeneratorFactory(const std::string& n,
|
|
|
|
const std::string& doc);
|
|
|
|
virtual ~cmExternalMakefileProjectGeneratorFactory();
|
|
|
|
|
|
|
|
std::string GetName() const;
|
|
|
|
std::string GetDocumentation() const;
|
|
|
|
std::vector<std::string> GetSupportedGlobalGenerators() const;
|
|
|
|
std::vector<std::string> Aliases;
|
|
|
|
|
|
|
|
virtual cmExternalMakefileProjectGenerator*
|
|
|
|
CreateExternalMakefileProjectGenerator() const = 0;
|
|
|
|
|
|
|
|
void AddSupportedGlobalGenerator(const std::string& base);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string Name;
|
|
|
|
std::string Documentation;
|
|
|
|
std::vector<std::string> SupportedGlobalGenerators;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
class cmExternalMakefileProjectGeneratorSimpleFactory
|
|
|
|
: public cmExternalMakefileProjectGeneratorFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmExternalMakefileProjectGeneratorSimpleFactory(const std::string& n,
|
|
|
|
const std::string& doc)
|
|
|
|
: cmExternalMakefileProjectGeneratorFactory(n, doc)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
cmExternalMakefileProjectGenerator* CreateExternalMakefileProjectGenerator()
|
|
|
|
const
|
|
|
|
{
|
|
|
|
T* p = new T;
|
|
|
|
p->SetName(GetName());
|
|
|
|
return p;
|
|
|
|
}
|
2007-06-08 19:57:16 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|