Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmGlobalWatcomWMakeGenerator.cxx
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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 "cmGlobalWatcomWMakeGenerator.h"
13 #include "cmLocalUnixMakefileGenerator3.h"
14 #include "cmMakefile.h"
15
16 cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
17 {
18   this->FindMakeProgramFile = "CMakeFindWMake.cmake";
19   this->ForceUnixPaths = false;
20   this->ToolSupportsColor = true;
21   this->NeedSymbolicMark = true;
22   this->EmptyRuleHackCommand = "@cd .";
23 }
24
25 void cmGlobalWatcomWMakeGenerator
26 ::EnableLanguage(std::vector<std::string>const& l,
27                  cmMakefile *mf,
28                  bool optional)
29 {
30   // pick a default
31   mf->AddDefinition("WATCOM", "1");
32   mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
33   mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
34   mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
35   mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
36   mf->AddDefinition("CMAKE_NO_QUOTED_OBJECTS", "1");
37   mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
38   mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
39   this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
40 }
41
42 ///! Create a local generator appropriate to this Global Generator
43 cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
44 {
45   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
46   lg->SetSilentNoColon(true);
47   lg->SetDefineWindowsNULL(true);
48   lg->SetWindowsShell(true);
49   lg->SetWatcomWMake(true);
50   lg->SetMakeSilentFlag("-s -h");
51   lg->SetGlobalGenerator(this);
52   lg->SetIgnoreLibPrefix(true);
53   lg->SetPassMakeflags(false);
54   lg->SetUnixCD(false);
55   lg->SetIncludeDirective("!include");
56   return lg;
57 }
58
59 //----------------------------------------------------------------------------
60 void cmGlobalWatcomWMakeGenerator
61 ::GetDocumentation(cmDocumentationEntry& entry)
62 {
63   entry.Name = cmGlobalWatcomWMakeGenerator::GetActualName();
64   entry.Brief = "Generates Watcom WMake makefiles.";
65   entry.Full = "";
66 }