1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
11 #include "cmGlobalVisualStudioGenerator.h"
12 #include "cmLocalGenerator.h"
13 #include "cmVsProjectType.h"
15 class cmCustomCommand
;
16 class cmCustomCommandGenerator
;
17 class cmGeneratorTarget
;
18 class cmGlobalGenerator
;
22 /** \class cmLocalVisualStudioGenerator
23 * \brief Base class for Visual Studio generators.
25 * cmLocalVisualStudioGenerator provides functionality common to all
26 * Visual Studio generators.
28 class cmLocalVisualStudioGenerator
: public cmLocalGenerator
31 cmLocalVisualStudioGenerator(cmGlobalGenerator
* gg
, cmMakefile
* mf
);
32 ~cmLocalVisualStudioGenerator() override
;
34 virtual bool IsVFProj() const = 0;
36 std::string
ConstructScript(cmCustomCommandGenerator
const& ccg
,
37 const std::string
& newline
= "\n");
38 std::string
FinishConstructScript(VsProjectType projectType
,
39 const std::string
& newline
= "\n");
41 /** Label to which to jump in a batch file after a failed step in a
42 sequence of custom commands. */
43 const char* GetReportErrorLabel() const;
45 cmGlobalVisualStudioGenerator::VSVersion
GetVersion() const;
47 virtual std::string
ComputeLongestObjectDirectory(
48 cmGeneratorTarget
const*) const = 0;
50 void ComputeObjectFilenames(
51 std::map
<cmSourceFile
const*, std::string
>& mapping
,
52 cmGeneratorTarget
const* = nullptr) override
;
55 virtual const char* ReportErrorLabel() const;
56 virtual bool CustomCommandUseLocal() const { return false; }
58 /** Construct a custom command to make exe import lib dir. */
59 std::unique_ptr
<cmCustomCommand
> MaybeCreateImplibDir(
60 cmGeneratorTarget
* target
, const std::string
& config
, bool isFortran
);