2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2009-06-25 20:41:57 +00:00
|
|
|
#ifndef cmVisualStudioTargetGenerator_h
|
|
|
|
#define cmVisualStudioTargetGenerator_h
|
2016-04-29 13:40:20 +00:00
|
|
|
|
2016-09-01 18:05:48 +00:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2016-11-25 21:54:58 +00:00
|
|
|
#include <iosfwd>
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2009-06-25 20:41:57 +00:00
|
|
|
|
2016-11-25 21:54:58 +00:00
|
|
|
class cmComputeLinkInformation;
|
|
|
|
class cmCustomCommand;
|
2009-06-25 20:41:57 +00:00
|
|
|
class cmGeneratedFileStream;
|
2016-11-25 21:54:58 +00:00
|
|
|
class cmGeneratorTarget;
|
2009-10-22 12:24:11 +00:00
|
|
|
class cmGlobalVisualStudio10Generator;
|
2009-06-25 20:41:57 +00:00
|
|
|
class cmLocalVisualStudio7Generator;
|
2016-11-25 21:54:58 +00:00
|
|
|
class cmMakefile;
|
|
|
|
class cmSourceFile;
|
|
|
|
class cmSourceGroup;
|
2009-10-23 15:34:37 +00:00
|
|
|
class cmVisualStudioGeneratorOptions;
|
2009-06-25 20:41:57 +00:00
|
|
|
|
|
|
|
class cmVisualStudio10TargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
2015-10-22 16:27:57 +00:00
|
|
|
cmVisualStudio10TargetGenerator(cmGeneratorTarget* target,
|
2009-10-22 12:24:11 +00:00
|
|
|
cmGlobalVisualStudio10Generator* gg);
|
2009-06-25 20:41:57 +00:00
|
|
|
~cmVisualStudio10TargetGenerator();
|
|
|
|
void Generate();
|
2012-08-13 17:42:58 +00:00
|
|
|
// used by cmVisualStudioGeneratorOptions
|
2016-05-16 14:34:04 +00:00
|
|
|
void WritePlatformConfigTag(const char* tag, const std::string& config,
|
|
|
|
int indentLevel, const char* attribute = 0,
|
|
|
|
const char* end = 0, std::ostream* strm = 0);
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2009-06-25 20:41:57 +00:00
|
|
|
private:
|
2012-04-27 13:21:08 +00:00
|
|
|
struct ToolSource
|
|
|
|
{
|
2014-03-12 22:50:42 +00:00
|
|
|
cmSourceFile const* SourceFile;
|
2012-04-27 13:21:08 +00:00
|
|
|
bool RelativePath;
|
|
|
|
};
|
2016-05-16 14:34:04 +00:00
|
|
|
struct ToolSources : public std::vector<ToolSource>
|
|
|
|
{
|
|
|
|
};
|
2012-04-27 13:21:08 +00:00
|
|
|
|
2016-11-04 16:02:22 +00:00
|
|
|
struct TargetsFileAndConfigs
|
|
|
|
{
|
|
|
|
std::string File;
|
|
|
|
std::vector<std::string> Configs;
|
|
|
|
};
|
|
|
|
|
2012-04-27 14:42:23 +00:00
|
|
|
std::string ConvertPath(std::string const& path, bool forceRelative);
|
2009-06-25 20:41:57 +00:00
|
|
|
void ConvertToWindowsSlash(std::string& s);
|
|
|
|
void WriteString(const char* line, int indentLevel);
|
|
|
|
void WriteProjectConfigurations();
|
|
|
|
void WriteProjectConfigurationValues();
|
2014-06-05 18:57:23 +00:00
|
|
|
void WriteMSToolConfigurationValues(std::string const& config);
|
2017-01-09 15:34:13 +00:00
|
|
|
void WriteMSToolConfigurationValuesManaged(std::string const& config);
|
2014-07-29 17:36:53 +00:00
|
|
|
void WriteHeaderSource(cmSourceFile const* sf);
|
2014-07-29 17:32:22 +00:00
|
|
|
void WriteExtraSource(cmSourceFile const* sf);
|
2014-06-10 15:33:19 +00:00
|
|
|
void WriteNsightTegraConfigurationValues(std::string const& config);
|
2014-07-29 17:26:19 +00:00
|
|
|
void WriteSource(std::string const& tool, cmSourceFile const* sf,
|
2014-03-12 22:50:42 +00:00
|
|
|
const char* end = 0);
|
2014-07-29 17:26:19 +00:00
|
|
|
void WriteSources(std::string const& tool,
|
2014-03-12 22:06:05 +00:00
|
|
|
std::vector<cmSourceFile const*> const&);
|
2012-03-19 15:25:21 +00:00
|
|
|
void WriteAllSources();
|
2011-11-23 19:11:00 +00:00
|
|
|
void WriteDotNetReferences();
|
2016-12-13 07:49:39 +00:00
|
|
|
void WriteDotNetReference(std::string const& ref, std::string const& hint);
|
2013-06-28 07:04:01 +00:00
|
|
|
void WriteEmbeddedResourceGroup();
|
2012-02-03 14:07:12 +00:00
|
|
|
void WriteWinRTReferences();
|
2014-08-11 18:17:12 +00:00
|
|
|
void WriteWinRTPackageCertificateKeyFile();
|
2015-03-31 20:49:39 +00:00
|
|
|
void WriteXamlFilesGroup();
|
2009-06-25 20:41:57 +00:00
|
|
|
void WritePathAndIncrementalLinkOptions();
|
|
|
|
void WriteItemDefinitionGroups();
|
2014-08-14 21:52:53 +00:00
|
|
|
void VerifyNecessaryFiles();
|
|
|
|
void WriteMissingFiles();
|
|
|
|
void WriteMissingFilesWP80();
|
|
|
|
void WriteMissingFilesWP81();
|
|
|
|
void WriteMissingFilesWS80();
|
|
|
|
void WriteMissingFilesWS81();
|
2015-10-02 18:34:55 +00:00
|
|
|
void WriteMissingFilesWS10_0();
|
|
|
|
void WritePlatformExtensions();
|
|
|
|
void WriteSinglePlatformExtension(std::string const& extension,
|
|
|
|
std::string const& version);
|
|
|
|
void WriteSDKReferences();
|
|
|
|
void WriteSingleSDKReference(std::string const& extension,
|
|
|
|
std::string const& version);
|
2014-08-14 21:52:53 +00:00
|
|
|
void WriteCommonMissingFiles(const std::string& manifestFile);
|
|
|
|
void WriteTargetSpecificReferences();
|
2016-11-04 16:02:22 +00:00
|
|
|
void WriteTargetsFileReferences();
|
2013-04-29 14:48:22 +00:00
|
|
|
|
2010-09-30 12:48:38 +00:00
|
|
|
bool ComputeClOptions();
|
|
|
|
bool ComputeClOptions(std::string const& configName);
|
2009-06-25 20:41:57 +00:00
|
|
|
void WriteClOptions(std::string const& config,
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<std::string> const& includes);
|
2014-07-09 23:01:18 +00:00
|
|
|
bool ComputeRcOptions();
|
|
|
|
bool ComputeRcOptions(std::string const& config);
|
2009-06-25 20:41:57 +00:00
|
|
|
void WriteRCOptions(std::string const& config,
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<std::string> const& includes);
|
2014-08-13 15:20:20 +00:00
|
|
|
bool ComputeMasmOptions();
|
|
|
|
bool ComputeMasmOptions(std::string const& config);
|
|
|
|
void WriteMasmOptions(std::string const& config,
|
|
|
|
std::vector<std::string> const& includes);
|
2012-10-26 14:16:45 +00:00
|
|
|
bool ComputeLinkOptions();
|
|
|
|
bool ComputeLinkOptions(std::string const& config);
|
2016-11-04 16:02:22 +00:00
|
|
|
bool ComputeLibOptions();
|
|
|
|
bool ComputeLibOptions(std::string const& config);
|
2009-06-25 20:41:57 +00:00
|
|
|
void WriteLinkOptions(std::string const& config);
|
|
|
|
void WriteMidlOptions(std::string const& config,
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<std::string> const& includes);
|
2014-09-02 18:33:17 +00:00
|
|
|
void WriteAntBuildOptions(std::string const& config);
|
2009-06-25 20:41:57 +00:00
|
|
|
void OutputLinkIncremental(std::string const& configName);
|
2014-03-12 22:50:42 +00:00
|
|
|
void WriteCustomRule(cmSourceFile const* source,
|
2016-05-16 14:34:04 +00:00
|
|
|
cmCustomCommand const& command);
|
2009-06-25 20:41:57 +00:00
|
|
|
void WriteCustomCommands();
|
2014-03-12 22:50:42 +00:00
|
|
|
void WriteCustomCommand(cmSourceFile const* sf);
|
2009-06-25 20:41:57 +00:00
|
|
|
void WriteGroups();
|
|
|
|
void WriteProjectReferences();
|
2014-07-31 17:22:35 +00:00
|
|
|
void WriteApplicationTypeSettings();
|
2014-03-12 22:50:42 +00:00
|
|
|
bool OutputSourceSpecificFlags(cmSourceFile const* source);
|
2014-07-23 15:13:13 +00:00
|
|
|
void AddLibraries(cmComputeLinkInformation& cli,
|
2016-11-04 16:02:22 +00:00
|
|
|
std::vector<std::string>& libVec,
|
|
|
|
std::vector<std::string>& vsTargetVec);
|
|
|
|
void AddTargetsFileAndConfigPair(std::string const& targetsFile,
|
|
|
|
std::string const& config);
|
2009-06-28 13:46:25 +00:00
|
|
|
void WriteLibOptions(std::string const& config);
|
2015-09-16 14:24:16 +00:00
|
|
|
void WriteManifestOptions(std::string const& config);
|
2009-07-10 13:12:39 +00:00
|
|
|
void WriteEvents(std::string const& configName);
|
2013-11-19 10:05:47 +00:00
|
|
|
void WriteEvent(const char* name,
|
|
|
|
std::vector<cmCustomCommand> const& commands,
|
2009-07-10 13:12:39 +00:00
|
|
|
std::string const& configName);
|
2012-04-27 13:21:08 +00:00
|
|
|
void WriteGroupSources(const char* name, ToolSources const& sources,
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<cmSourceGroup>&);
|
2010-06-11 19:33:38 +00:00
|
|
|
void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed,
|
|
|
|
const std::vector<cmSourceGroup>& allGroups);
|
2013-04-29 14:48:22 +00:00
|
|
|
bool IsResxHeader(const std::string& headerFile);
|
2015-03-31 20:49:39 +00:00
|
|
|
bool IsXamlHeader(const std::string& headerFile);
|
|
|
|
bool IsXamlSource(const std::string& headerFile);
|
2010-06-11 19:33:38 +00:00
|
|
|
|
2015-09-28 13:33:10 +00:00
|
|
|
bool ForceOld(const std::string& source) const;
|
|
|
|
|
2009-06-25 20:41:57 +00:00
|
|
|
private:
|
2009-10-23 15:34:37 +00:00
|
|
|
typedef cmVisualStudioGeneratorOptions Options;
|
2014-02-10 05:21:34 +00:00
|
|
|
typedef std::map<std::string, Options*> OptionsMap;
|
2009-10-23 15:34:37 +00:00
|
|
|
OptionsMap ClOptions;
|
2014-07-09 23:01:18 +00:00
|
|
|
OptionsMap RcOptions;
|
2014-08-13 15:20:20 +00:00
|
|
|
OptionsMap MasmOptions;
|
2012-10-26 14:16:45 +00:00
|
|
|
OptionsMap LinkOptions;
|
2016-12-01 11:07:03 +00:00
|
|
|
std::string PathToProjectFile;
|
|
|
|
std::string ProjectFileExtension;
|
|
|
|
enum VsProjectType
|
|
|
|
{
|
|
|
|
vcxproj,
|
|
|
|
csproj
|
|
|
|
} ProjectType;
|
|
|
|
bool InSourceBuild;
|
2015-05-20 17:55:21 +00:00
|
|
|
std::vector<std::string> Configurations;
|
2016-11-04 16:02:22 +00:00
|
|
|
std::vector<TargetsFileAndConfigs> TargetsFileAndConfigsVec;
|
2012-03-07 16:56:21 +00:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
2009-06-25 20:41:57 +00:00
|
|
|
cmMakefile* Makefile;
|
|
|
|
std::string Platform;
|
|
|
|
std::string GUID;
|
2009-07-13 20:58:24 +00:00
|
|
|
std::string Name;
|
2014-06-10 14:13:00 +00:00
|
|
|
bool MSTools;
|
2016-12-01 11:07:03 +00:00
|
|
|
bool Managed;
|
2014-06-10 15:33:19 +00:00
|
|
|
bool NsightTegra;
|
2016-05-16 14:34:04 +00:00
|
|
|
int NsightTegraVersion[4];
|
2014-08-22 13:27:00 +00:00
|
|
|
bool TargetCompileAsWinRT;
|
2009-10-22 12:24:11 +00:00
|
|
|
cmGlobalVisualStudio10Generator* GlobalGenerator;
|
2009-06-25 20:41:57 +00:00
|
|
|
cmGeneratedFileStream* BuildFileStream;
|
|
|
|
cmLocalVisualStudio7Generator* LocalGenerator;
|
2014-03-12 22:50:42 +00:00
|
|
|
std::set<cmSourceFile const*> SourcesVisited;
|
2014-08-14 21:52:53 +00:00
|
|
|
bool IsMissingFiles;
|
|
|
|
std::vector<std::string> AddedFiles;
|
|
|
|
std::string DefaultArtifactDir;
|
2012-04-27 13:21:08 +00:00
|
|
|
|
2014-02-10 05:21:34 +00:00
|
|
|
typedef std::map<std::string, ToolSources> ToolSourceMap;
|
2012-04-27 13:21:08 +00:00
|
|
|
ToolSourceMap Tools;
|
2009-06-25 20:41:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|