2009-11-05 23:00:15 +03:00
|
|
|
/*============================================================================
|
|
|
|
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.
|
|
|
|
============================================================================*/
|
|
|
|
#include "cmGlobalJOMMakefileGenerator.h"
|
|
|
|
#include "cmLocalUnixMakefileGenerator3.h"
|
|
|
|
#include "cmMakefile.h"
|
|
|
|
|
|
|
|
cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator()
|
|
|
|
{
|
|
|
|
this->FindMakeProgramFile = "CMakeJOMFindMake.cmake";
|
|
|
|
this->ForceUnixPaths = false;
|
|
|
|
this->ToolSupportsColor = true;
|
|
|
|
this->UseLinkScript = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void cmGlobalJOMMakefileGenerator
|
2012-08-13 21:42:58 +04:00
|
|
|
::EnableLanguage(std::vector<std::string>const& l,
|
|
|
|
cmMakefile *mf,
|
2009-11-05 23:00:15 +03:00
|
|
|
bool optional)
|
|
|
|
{
|
2012-08-13 21:42:58 +04:00
|
|
|
// pick a default
|
2009-11-05 23:00:15 +03:00
|
|
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
|
|
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
2012-08-13 21:42:58 +04:00
|
|
|
if(!(cmSystemTools::GetEnv("INCLUDE") &&
|
2009-11-05 23:00:15 +03:00
|
|
|
cmSystemTools::GetEnv("LIB"))
|
|
|
|
)
|
|
|
|
{
|
|
|
|
std::string message = "To use the JOM generator, cmake must be run "
|
|
|
|
"from a shell that can use the compiler cl from the command line. "
|
|
|
|
"This environment does not contain INCLUDE, LIB, or LIBPATH, and "
|
|
|
|
"these must be set for the cl compiler to work. ";
|
|
|
|
mf->IssueMessage(cmake::WARNING,
|
|
|
|
message);
|
|
|
|
}
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2009-11-05 23:00:15 +03:00
|
|
|
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
|
|
|
|
}
|
|
|
|
|
|
|
|
///! Create a local generator appropriate to this Global Generator
|
2015-04-28 08:50:52 +03:00
|
|
|
cmLocalGenerator *
|
|
|
|
cmGlobalJOMMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
2009-11-05 23:00:15 +03:00
|
|
|
{
|
2015-04-28 08:50:52 +03:00
|
|
|
cmLocalUnixMakefileGenerator3* lg
|
|
|
|
= new cmLocalUnixMakefileGenerator3(parent);
|
2009-11-05 23:00:15 +03:00
|
|
|
lg->SetDefineWindowsNULL(true);
|
|
|
|
lg->SetWindowsShell(true);
|
|
|
|
lg->SetMakeSilentFlag("/nologo");
|
|
|
|
lg->SetGlobalGenerator(this);
|
|
|
|
lg->SetIgnoreLibPrefix(true);
|
|
|
|
lg->SetPassMakeflags(true);
|
|
|
|
lg->SetNMake(true);
|
|
|
|
lg->SetUnixCD(false);
|
|
|
|
return lg;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void cmGlobalJOMMakefileGenerator
|
2012-11-19 19:42:24 +04:00
|
|
|
::GetDocumentation(cmDocumentationEntry& entry)
|
2009-11-05 23:00:15 +03:00
|
|
|
{
|
2012-11-19 19:42:24 +04:00
|
|
|
entry.Name = cmGlobalJOMMakefileGenerator::GetActualName();
|
2009-11-05 23:00:15 +03:00
|
|
|
entry.Brief = "Generates JOM makefiles.";
|
|
|
|
}
|