123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- #ifndef cmGlobalVisualStudioGenerator_h
- #define cmGlobalVisualStudioGenerator_h
- #include "cmConfigure.h"
- #include <iosfwd>
- #include <map>
- #include <set>
- #include <string>
- #include <vector>
- #include "cmGlobalGenerator.h"
- #include "cmTargetDepend.h"
- class cmCustomCommand;
- class cmGeneratorTarget;
- class cmLocalGenerator;
- class cmMakefile;
- class cmake;
- class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
- {
- public:
-
- enum VSVersion
- {
- VS8 = 80,
- VS9 = 90,
- VS10 = 100,
- VS11 = 110,
- VS12 = 120,
-
- VS14 = 140,
- VS15 = 150
- };
- cmGlobalVisualStudioGenerator(cmake* cm);
- virtual ~cmGlobalVisualStudioGenerator();
- VSVersion GetVersion() const;
- void SetVersion(VSVersion v);
-
- virtual void ConfigureCMakeVisualStudioMacros();
-
- virtual std::string GetUserMacrosDirectory();
-
- virtual std::string GetUserMacrosRegKeyBase();
- enum MacroName
- {
- MacroReload,
- MacroStop
- };
-
- void CallVisualStudioMacro(MacroName m, const char* vsSolutionFile = 0);
-
- bool TargetIsFortranOnly(const cmGeneratorTarget* gt);
-
- static bool TargetIsCSharpOnly(cmGeneratorTarget const* gt);
-
- bool TargetCanBeReferenced(cmGeneratorTarget const* gt);
-
- std::string GetRegistryBase();
-
- static std::string GetRegistryBase(const char* version);
-
- bool IsMultiConfig() const override { return true; }
-
- virtual bool TargetsWindowsCE() const { return false; }
- bool IsIncludeExternalMSProjectSupported() const override { return true; }
- class TargetSet : public std::set<cmGeneratorTarget const*>
- {
- };
- class TargetCompare
- {
- std::string First;
- public:
- TargetCompare(std::string const& first)
- : First(first)
- {
- }
- bool operator()(cmGeneratorTarget const* l,
- cmGeneratorTarget const* r) const;
- };
- class OrderedTargetDependSet;
- bool FindMakeProgram(cmMakefile*) override;
- std::string ExpandCFGIntDir(const std::string& str,
- const std::string& config) const override;
- void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
- std::string GetStartupProjectName(cmLocalGenerator const* root) const;
- void AddSymbolExportCommand(cmGeneratorTarget*,
- std::vector<cmCustomCommand>& commands,
- std::string const& configName);
- bool Open(const std::string& bindir, const std::string& projectName,
- bool dryRun) override;
- protected:
- void AddExtraIDETargets() override;
-
-
-
- virtual bool VSLinksDependencies() const { return true; }
- virtual const char* GetIDEVersion() = 0;
- bool ComputeTargetDepends() override;
- class VSDependSet : public std::set<std::string>
- {
- };
- class VSDependMap : public std::map<cmGeneratorTarget const*, VSDependSet>
- {
- };
- VSDependMap VSTargetDepends;
- void ComputeVSTargetDepends(cmGeneratorTarget*);
- bool CheckTargetLinks(cmGeneratorTarget& target, const std::string& name);
- std::string GetUtilityForTarget(cmGeneratorTarget& target,
- const std::string&);
- virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0;
- std::string GetUtilityDepend(const cmGeneratorTarget* target);
- typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap;
- UtilityDependsMap UtilityDepends;
- protected:
- VSVersion Version;
- private:
- virtual std::string GetVSMakeProgram() = 0;
- void PrintCompilerAdvice(std::ostream&, std::string const&,
- const char*) const
- {
- }
- void FollowLinkDepends(cmGeneratorTarget const* target,
- std::set<cmGeneratorTarget const*>& linked);
- class TargetSetMap : public std::map<cmGeneratorTarget*, TargetSet>
- {
- };
- TargetSetMap TargetLinkClosure;
- void FillLinkClosure(const cmGeneratorTarget* target, TargetSet& linked);
- TargetSet const& GetTargetLinkClosure(cmGeneratorTarget* target);
- };
- class cmGlobalVisualStudioGenerator::OrderedTargetDependSet
- : public std::multiset<cmTargetDepend,
- cmGlobalVisualStudioGenerator::TargetCompare>
- {
- typedef std::multiset<cmTargetDepend,
- cmGlobalVisualStudioGenerator::TargetCompare>
- derived;
- public:
- typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
- typedef cmGlobalVisualStudioGenerator::TargetSet TargetSet;
- OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
- OrderedTargetDependSet(TargetSet const&, std::string const& first);
- };
- #endif
|