Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmGlobalNMakeMakefileGenerator.cxx
blob5f80f1ef3cc6910c77ed288942f80363faa29f81
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalNMakeMakefileGenerator.cxx,v $
5 Language: C++
6 Date: $Date: 2009-03-27 15:18:58 $
7 Version: $Revision: 1.28 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmGlobalNMakeMakefileGenerator.h"
18 #include "cmLocalUnixMakefileGenerator3.h"
19 #include "cmMakefile.h"
21 cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
23 this->FindMakeProgramFile = "CMakeNMakeFindMake.cmake";
24 this->ForceUnixPaths = false;
25 this->ToolSupportsColor = true;
26 this->UseLinkScript = false;
29 void cmGlobalNMakeMakefileGenerator
30 ::EnableLanguage(std::vector<std::string>const& l,
31 cmMakefile *mf,
32 bool optional)
34 // pick a default
35 mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
36 mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
37 if(!(cmSystemTools::GetEnv("INCLUDE") &&
38 cmSystemTools::GetEnv("LIB"))
41 std::string message = "To use the NMake generator, cmake must be run "
42 "from a shell that can use the compiler cl from the command line. "
43 "This environment does not contain INCLUDE, LIB, or LIBPATH, and "
44 "these must be set for the cl compiler to work. ";
45 mf->IssueMessage(cmake::WARNING,
46 message);
49 this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
52 ///! Create a local generator appropriate to this Global Generator
53 cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
55 cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
56 lg->SetDefineWindowsNULL(true);
57 lg->SetWindowsShell(true);
58 lg->SetMakeSilentFlag("/nologo");
59 lg->SetGlobalGenerator(this);
60 lg->SetIgnoreLibPrefix(true);
61 lg->SetPassMakeflags(true);
62 lg->SetNMake(true);
63 lg->SetUnixCD(false);
64 return lg;
67 //----------------------------------------------------------------------------
68 void cmGlobalNMakeMakefileGenerator
69 ::GetDocumentation(cmDocumentationEntry& entry) const
71 entry.Name = this->GetName();
72 entry.Brief = "Generates NMake makefiles.";
73 entry.Full = "";