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