1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmGlobalNMakeMakefileGenerator.h"
13 #include "cmLocalUnixMakefileGenerator3.h"
14 #include "cmMakefile.h"
16 cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
18 this->FindMakeProgramFile = "CMakeNMakeFindMake.cmake";
19 this->ForceUnixPaths = false;
20 this->ToolSupportsColor = true;
21 this->UseLinkScript = false;
24 void cmGlobalNMakeMakefileGenerator
25 ::EnableLanguage(std::vector<std::string>const& l,
30 mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
31 mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
32 if(!(cmSystemTools::GetEnv("INCLUDE") &&
33 cmSystemTools::GetEnv("LIB"))
36 std::string message = "To use the NMake generator, cmake must be run "
37 "from a shell that can use the compiler cl from the command line. "
38 "This environment does not contain INCLUDE, LIB, or LIBPATH, and "
39 "these must be set for the cl compiler to work. ";
40 mf->IssueMessage(cmake::WARNING,
44 this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
47 ///! Create a local generator appropriate to this Global Generator
48 cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
50 cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
51 lg->SetDefineWindowsNULL(true);
52 lg->SetWindowsShell(true);
53 lg->SetMakeSilentFlag("/nologo");
54 lg->SetGlobalGenerator(this);
55 lg->SetIgnoreLibPrefix(true);
56 lg->SetPassMakeflags(true);
62 //----------------------------------------------------------------------------
63 void cmGlobalNMakeMakefileGenerator
64 ::GetDocumentation(cmDocumentationEntry& entry)
66 entry.Name = cmGlobalNMakeMakefileGenerator::GetActualName();
67 entry.Brief = "Generates NMake makefiles.";