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 "cmExternalMakefileProjectGenerator.h"
|
|
|
|
|
2016-04-29 16:40:20 +03:00
|
|
|
#include <assert.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)
|
|
|
|
{
|
2014-03-11 03:04:11 +04:00
|
|
|
if (this->CreateFullGeneratorName(*it, this->GetName())
|
2007-06-08 19:57:16 +04:00
|
|
|
== 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
|
|
|
}
|