1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
10 #include "cm_codecvt.hxx"
12 #include "cmGlobalGeneratorFactory.h"
13 #include "cmGlobalUnixMakefileGenerator3.h"
18 struct cmDocumentationEntry;
20 /** \class cmGlobalNMakeMakefileGenerator
21 * \brief Write a NMake makefiles.
23 * cmGlobalNMakeMakefileGenerator manages nmake build process for a tree
25 class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3
28 cmGlobalNMakeMakefileGenerator(cmake* cm);
29 static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory()
31 return std::unique_ptr<cmGlobalGeneratorFactory>(
32 new cmGlobalGeneratorSimpleFactory<cmGlobalNMakeMakefileGenerator>());
34 //! Get the name for the generator.
35 std::string GetName() const override
37 return cmGlobalNMakeMakefileGenerator::GetActualName();
39 static std::string GetActualName() { return "NMake Makefiles"; }
41 /** Get encoding used by generator for makefile files */
42 codecvt::Encoding GetMakefileEncoding() const override
44 return this->NMakeSupportsUTF8 ? codecvt::UTF8_WITH_BOM : codecvt::ANSI;
47 /** Get the documentation entry for this generator. */
48 static void GetDocumentation(cmDocumentationEntry& entry);
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;
58 std::vector<GeneratedMakeCommand> GenerateBuildCommand(
59 const std::string& makeProgram, const std::string& projectName,
60 const std::string& projectDir, std::vector<std::string> const& targetNames,
61 const std::string& config, int jobs, bool verbose,
62 const cmBuildOptions& buildOptions = cmBuildOptions(),
63 std::vector<std::string> const& makeOptions =
64 std::vector<std::string>()) override;
66 void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;
69 bool NMakeSupportsUTF8 = false;
70 std::string NMakeVersion;
71 bool FindMakeProgram(cmMakefile* mf) override;
72 void CheckNMakeFeatures();
74 void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
75 cmValue envVar) const override;