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
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
2013-08-29 22:43:54 +04:00
|
|
|
void cmExternalMakefileProjectGenerator
|
|
|
|
::EnableLanguage(std::vector<std::string> const&,
|
|
|
|
cmMakefile *, bool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-06-08 19:57:16 +04:00
|
|
|
std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
|
2014-02-25 02:36:27 +04:00
|
|
|
const std::string& globalGenerator,
|
|
|
|
const std::string& extraGenerator)
|
2007-06-08 19:57:16 +04:00
|
|
|
{
|
|
|
|
std::string fullName;
|
2014-02-25 02:36:27 +04:00
|
|
|
if (!globalGenerator.empty())
|
2007-06-08 19:57:16 +04:00
|
|
|
{
|
2014-02-25 02:36:27 +04:00
|
|
|
if (!extraGenerator.empty())
|
2007-06-08 19:57:16 +04:00
|
|
|
{
|
2007-07-04 00:10:50 +04:00
|
|
|
fullName = extraGenerator;
|
2007-06-08 19:57:16 +04:00
|
|
|
fullName += " - ";
|
|
|
|
}
|
2007-07-04 00:10:50 +04:00
|
|
|
fullName += globalGenerator;
|
2007-06-08 19:57:16 +04:00
|
|
|
}
|
|
|
|
return fullName;
|
|
|
|
}
|
|
|
|
|
2014-02-25 02:36:27 +04:00
|
|
|
std::string cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
|
|
|
|
const std::string& fullName)
|
2007-06-08 19:57:16 +04:00
|
|
|
{
|
|
|
|
// at least one global generator must be supported
|
|
|
|
assert(!this->SupportedGlobalGenerators.empty());
|
|
|
|
|
2014-02-25 02:36:27 +04:00
|
|
|
if (fullName.empty())
|
2007-06-08 19:57:16 +04:00
|
|
|
{
|
2014-02-25 02:36:27 +04:00
|
|
|
return "";
|
2007-06-08 19:57:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string currentName = fullName;
|
|
|
|
// if we get only the short name, take the first global generator as default
|
|
|
|
if (currentName == this->GetName())
|
|
|
|
{
|
2014-02-25 02:36:27 +04:00
|
|
|
return this->SupportedGlobalGenerators[0];
|
2007-06-08 19:57:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// otherwise search for the matching global generator
|
2012-08-13 21:42:58 +04:00
|
|
|
for (std::vector<std::string>::const_iterator
|
2007-06-08 19:57:16 +04:00
|
|
|
it = this->SupportedGlobalGenerators.begin();
|
|
|
|
it != this->SupportedGlobalGenerators.end();
|
|
|
|
++it)
|
|
|
|
{
|
|
|
|
if (this->CreateFullGeneratorName(it->c_str(), this->GetName())
|
|
|
|
== currentName)
|
|
|
|
{
|
2014-02-25 02:36:27 +04:00
|
|
|
return *it;
|
2007-06-08 19:57:16 +04:00
|
|
|
}
|
|
|
|
}
|
2014-02-25 02:36:27 +04:00
|
|
|
return "";
|
2007-06-08 19:57:16 +04:00
|
|
|
}
|