2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2009-06-26 00:41:57 +04:00
|
|
|
#ifndef cmVisualStudioTargetGenerator_h
|
|
|
|
#define cmVisualStudioTargetGenerator_h
|
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
|
|
|
|
class cmTarget;
|
|
|
|
class cmMakefile;
|
2012-03-07 20:56:21 +04:00
|
|
|
class cmGeneratorTarget;
|
2009-06-26 00:41:57 +04:00
|
|
|
class cmGeneratedFileStream;
|
2009-10-22 16:24:11 +04:00
|
|
|
class cmGlobalVisualStudio10Generator;
|
2009-06-26 00:41:57 +04:00
|
|
|
class cmSourceFile;
|
|
|
|
class cmCustomCommand;
|
|
|
|
class cmLocalVisualStudio7Generator;
|
|
|
|
class cmComputeLinkInformation;
|
2009-10-23 19:34:37 +04:00
|
|
|
class cmVisualStudioGeneratorOptions;
|
2009-07-11 08:05:20 +04:00
|
|
|
#include "cmSourceGroup.h"
|
2009-06-26 00:41:57 +04:00
|
|
|
|
|
|
|
class cmVisualStudio10TargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmVisualStudio10TargetGenerator(cmTarget* target,
|
2009-10-22 16:24:11 +04:00
|
|
|
cmGlobalVisualStudio10Generator* gg);
|
2009-06-26 00:41:57 +04:00
|
|
|
~cmVisualStudio10TargetGenerator();
|
|
|
|
void Generate();
|
|
|
|
// used by cmVisualStudioGeneratorOptions
|
|
|
|
void WritePlatformConfigTag(
|
|
|
|
const char* tag,
|
|
|
|
const char* config,
|
|
|
|
int indentLevel,
|
|
|
|
const char* attribute = 0,
|
|
|
|
const char* end = 0,
|
|
|
|
std::ostream* strm = 0
|
|
|
|
);
|
|
|
|
|
|
|
|
private:
|
2012-04-27 17:21:08 +04:00
|
|
|
struct ToolSource
|
|
|
|
{
|
|
|
|
cmSourceFile* SourceFile;
|
|
|
|
bool RelativePath;
|
|
|
|
};
|
|
|
|
struct ToolSources: public std::vector<ToolSource> {};
|
|
|
|
|
2012-04-27 18:42:23 +04:00
|
|
|
std::string ConvertPath(std::string const& path, bool forceRelative);
|
2009-06-26 00:41:57 +04:00
|
|
|
void ConvertToWindowsSlash(std::string& s);
|
|
|
|
void WriteString(const char* line, int indentLevel);
|
|
|
|
void WriteProjectConfigurations();
|
|
|
|
void WriteProjectConfigurationValues();
|
2012-04-27 16:34:49 +04:00
|
|
|
void WriteSource(const char* tool, cmSourceFile* sf, const char* end = 0);
|
2012-03-19 19:25:21 +04:00
|
|
|
void WriteSources(const char* tool, std::vector<cmSourceFile*> const&);
|
|
|
|
void WriteAllSources();
|
2011-11-23 23:11:00 +04:00
|
|
|
void WriteDotNetReferences();
|
2012-02-03 18:07:12 +04:00
|
|
|
void WriteWinRTReferences();
|
2009-06-26 00:41:57 +04:00
|
|
|
void WritePathAndIncrementalLinkOptions();
|
|
|
|
void WriteItemDefinitionGroups();
|
2010-09-30 16:48:38 +04:00
|
|
|
bool ComputeClOptions();
|
|
|
|
bool ComputeClOptions(std::string const& configName);
|
2009-06-26 00:41:57 +04:00
|
|
|
void WriteClOptions(std::string const& config,
|
|
|
|
std::vector<std::string> const & includes);
|
|
|
|
void WriteRCOptions(std::string const& config,
|
|
|
|
std::vector<std::string> const & includes);
|
|
|
|
void WriteLinkOptions(std::string const& config);
|
|
|
|
void WriteMidlOptions(std::string const& config,
|
|
|
|
std::vector<std::string> const & includes);
|
|
|
|
void OutputIncludes(std::vector<std::string> const & includes);
|
|
|
|
void OutputLinkIncremental(std::string const& configName);
|
|
|
|
void WriteCustomRule(cmSourceFile* source,
|
|
|
|
cmCustomCommand const & command);
|
|
|
|
void WriteCustomCommands();
|
2009-09-07 18:12:18 +04:00
|
|
|
void WriteCustomCommand(cmSourceFile* sf);
|
2009-06-26 00:41:57 +04:00
|
|
|
void WriteGroups();
|
|
|
|
void WriteProjectReferences();
|
|
|
|
bool OutputSourceSpecificFlags(cmSourceFile* source);
|
|
|
|
void AddLibraries(cmComputeLinkInformation& cli, std::string& libstring);
|
2009-06-28 17:46:25 +04:00
|
|
|
void WriteLibOptions(std::string const& config);
|
2009-07-10 17:12:39 +04:00
|
|
|
void WriteEvents(std::string const& configName);
|
|
|
|
void WriteEvent(const char* name, std::vector<cmCustomCommand> & commands,
|
|
|
|
std::string const& configName);
|
2012-04-27 17:21:08 +04:00
|
|
|
void WriteGroupSources(const char* name, ToolSources const& sources,
|
2009-07-11 08:05:20 +04:00
|
|
|
std::vector<cmSourceGroup>& );
|
2010-06-11 23:33:38 +04:00
|
|
|
void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed,
|
|
|
|
const std::vector<cmSourceGroup>& allGroups);
|
|
|
|
|
|
|
|
|
2009-06-26 00:41:57 +04:00
|
|
|
private:
|
2009-10-23 19:34:37 +04:00
|
|
|
typedef cmVisualStudioGeneratorOptions Options;
|
|
|
|
typedef std::map<cmStdString, Options*> OptionsMap;
|
|
|
|
OptionsMap ClOptions;
|
2009-07-10 17:12:39 +04:00
|
|
|
std::string PathToVcxproj;
|
2009-06-26 00:41:57 +04:00
|
|
|
cmTarget* Target;
|
2012-03-07 20:56:21 +04:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
2009-06-26 00:41:57 +04:00
|
|
|
cmMakefile* Makefile;
|
|
|
|
std::string Platform;
|
|
|
|
std::string GUID;
|
2009-07-14 00:58:24 +04:00
|
|
|
std::string Name;
|
2009-10-22 16:24:11 +04:00
|
|
|
cmGlobalVisualStudio10Generator* GlobalGenerator;
|
2009-06-26 00:41:57 +04:00
|
|
|
cmGeneratedFileStream* BuildFileStream;
|
|
|
|
cmLocalVisualStudio7Generator* LocalGenerator;
|
2009-09-07 18:12:18 +04:00
|
|
|
std::set<cmSourceFile*> SourcesVisited;
|
2012-04-27 17:21:08 +04:00
|
|
|
|
|
|
|
typedef std::map<cmStdString, ToolSources> ToolSourceMap;
|
|
|
|
ToolSourceMap Tools;
|
2009-06-26 00:41:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|