CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmGlobalNMakeMakefileGenerator.h
blobeafab838eca82946c1c887190a576b1159f998db
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include <iosfwd>
6 #include <memory>
7 #include <string>
8 #include <vector>
10 #include "cm_codecvt_Encoding.hxx"
12 #include "cmGlobalGeneratorFactory.h"
13 #include "cmGlobalUnixMakefileGenerator3.h"
14 #include "cmValue.h"
16 class cmMakefile;
17 class cmake;
19 /** \class cmGlobalNMakeMakefileGenerator
20 * \brief Write a NMake makefiles.
22 * cmGlobalNMakeMakefileGenerator manages nmake build process for a tree
24 class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3
26 public:
27 cmGlobalNMakeMakefileGenerator(cmake* cm);
28 static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory()
30 return std::unique_ptr<cmGlobalGeneratorFactory>(
31 new cmGlobalGeneratorSimpleFactory<cmGlobalNMakeMakefileGenerator>());
33 //! Get the name for the generator.
34 std::string GetName() const override
36 return cmGlobalNMakeMakefileGenerator::GetActualName();
38 static std::string GetActualName() { return "NMake Makefiles"; }
40 /** Get encoding used by generator for makefile files */
41 codecvt_Encoding GetMakefileEncoding() const override
43 return this->NMakeSupportsUTF8 ? codecvt_Encoding::UTF8_WITH_BOM
44 : codecvt_Encoding::ANSI;
47 /** Get the documentation entry for this generator. */
48 static cmDocumentationEntry GetDocumentation();
50 /**
51 * Try to determine system information such as shared library
52 * extension, pthreads, byte order etc.
54 void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
55 bool optional) override;
57 bool IsGNUMakeJobServerAware() const override { return false; }
59 protected:
60 std::vector<GeneratedMakeCommand> GenerateBuildCommand(
61 const std::string& makeProgram, const std::string& projectName,
62 const std::string& projectDir, std::vector<std::string> const& targetNames,
63 const std::string& config, int jobs, bool verbose,
64 const cmBuildOptions& buildOptions = cmBuildOptions(),
65 std::vector<std::string> const& makeOptions =
66 std::vector<std::string>()) override;
68 void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;
70 private:
71 bool NMakeSupportsUTF8 = false;
72 std::string NMakeVersion;
73 bool FindMakeProgram(cmMakefile* mf) override;
74 void CheckNMakeFeatures();
76 void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
77 cmValue envVar) const override;