2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2002-09-04 23:23:56 +04:00
|
|
|
#ifndef cmLocalVisualStudio7Generator_h
|
|
|
|
#define cmLocalVisualStudio7Generator_h
|
|
|
|
|
2006-07-11 19:41:38 +04:00
|
|
|
#include "cmLocalVisualStudioGenerator.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2009-07-29 19:28:55 +04:00
|
|
|
#include "cmVisualStudioGeneratorOptions.h"
|
2002-09-04 23:23:56 +04:00
|
|
|
|
|
|
|
class cmSourceFile;
|
2003-06-03 18:30:23 +04:00
|
|
|
class cmCustomCommand;
|
|
|
|
class cmSourceGroup;
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2007-02-01 19:49:27 +03:00
|
|
|
class cmLocalVisualStudio7GeneratorOptions;
|
2008-01-14 17:20:58 +03:00
|
|
|
class cmLocalVisualStudio7GeneratorFCInfo;
|
2008-01-22 17:13:04 +03:00
|
|
|
class cmLocalVisualStudio7GeneratorInternals;
|
2007-02-01 19:49:27 +03:00
|
|
|
|
2002-09-04 23:23:56 +04:00
|
|
|
/** \class cmLocalVisualStudio7Generator
|
2006-07-11 19:41:38 +04:00
|
|
|
* \brief Write Visual Studio .NET project files.
|
2002-09-04 23:23:56 +04:00
|
|
|
*
|
2006-07-11 19:41:38 +04:00
|
|
|
* cmLocalVisualStudio7Generator produces a Visual Studio .NET project
|
|
|
|
* file for each target in its directory.
|
2002-09-04 23:23:56 +04:00
|
|
|
*/
|
2006-07-11 19:41:38 +04:00
|
|
|
class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
|
2002-09-04 23:23:56 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///! Set cache only and recurse to false by default.
|
2015-08-02 12:41:51 +03:00
|
|
|
cmLocalVisualStudio7Generator(cmGlobalGenerator* gg, cmMakefile* mf);
|
2002-09-04 23:23:56 +04:00
|
|
|
|
|
|
|
virtual ~cmLocalVisualStudio7Generator();
|
2007-05-09 22:41:38 +04:00
|
|
|
|
|
|
|
virtual void AddHelperCommands();
|
|
|
|
|
2002-09-04 23:23:56 +04:00
|
|
|
/**
|
2012-08-13 21:42:58 +04:00
|
|
|
* Generate the makefile for this directory.
|
2002-09-04 23:23:56 +04:00
|
|
|
*/
|
2005-03-18 18:41:41 +03:00
|
|
|
virtual void Generate();
|
2002-09-04 23:23:56 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
enum BuildType
|
|
|
|
{
|
|
|
|
STATIC_LIBRARY,
|
|
|
|
DLL,
|
|
|
|
EXECUTABLE,
|
|
|
|
WIN32_EXECUTABLE,
|
|
|
|
UTILITY
|
|
|
|
};
|
2002-09-04 23:23:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Specify the type of the build: static, dll, or executable.
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
void SetBuildType(BuildType, const std::string& name);
|
2002-09-04 23:23:56 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
virtual std::string GetTargetDirectory(
|
|
|
|
cmGeneratorTarget const* target) const;
|
2009-06-26 00:41:57 +04:00
|
|
|
cmSourceFile* CreateVCProjBuildRule();
|
|
|
|
void WriteStampFiles();
|
2016-05-16 17:34:04 +03:00
|
|
|
virtual std::string ComputeLongestObjectDirectory(
|
|
|
|
cmGeneratorTarget const*) const;
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2014-02-22 04:05:55 +04:00
|
|
|
virtual void ReadAndStoreExternalGUID(const std::string& name,
|
2009-07-14 00:58:24 +04:00
|
|
|
const char* path);
|
2012-03-28 21:49:01 +04:00
|
|
|
virtual void AddCMakeListsRules();
|
2016-05-16 17:34:04 +03:00
|
|
|
|
2011-07-09 01:08:43 +04:00
|
|
|
protected:
|
2016-05-16 17:34:04 +03:00
|
|
|
void CreateSingleVCProj(const std::string& lname, cmGeneratorTarget* tgt);
|
|
|
|
|
2002-09-04 23:23:56 +04:00
|
|
|
private:
|
2009-07-28 22:30:15 +04:00
|
|
|
typedef cmVisualStudioGeneratorOptions Options;
|
2008-01-14 17:20:58 +03:00
|
|
|
typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
|
2006-01-27 21:48:21 +03:00
|
|
|
std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
|
2014-02-10 07:48:34 +04:00
|
|
|
const std::string& configName);
|
2006-09-29 00:40:35 +04:00
|
|
|
void FixGlobalTargets();
|
2007-11-12 23:42:37 +03:00
|
|
|
void WriteProjectFiles();
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteVCProjHeader(std::ostream& fout, const std::string& libName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* tgt,
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<cmSourceGroup>& sgs);
|
2015-10-22 19:27:58 +03:00
|
|
|
void WriteVCProjFooter(std::ostream& fout, cmGeneratorTarget* target);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteVCProjFile(std::ostream& fout, const std::string& libName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* tgt);
|
2002-09-04 23:23:56 +04:00
|
|
|
void WriteConfigurations(std::ostream& fout,
|
2015-05-20 20:55:21 +03:00
|
|
|
std::vector<std::string> const& configs,
|
2015-10-22 19:27:58 +03:00
|
|
|
const std::string& libName, cmGeneratorTarget* tgt);
|
2016-05-16 17:34:04 +03:00
|
|
|
void WriteConfiguration(std::ostream& fout, const std::string& configName,
|
2015-10-22 19:27:58 +03:00
|
|
|
const std::string& libName, cmGeneratorTarget* tgt);
|
2014-02-08 09:29:59 +04:00
|
|
|
std::string EscapeForXML(const std::string& s);
|
2002-09-04 23:23:56 +04:00
|
|
|
std::string ConvertToXMLOutputPath(const char* path);
|
|
|
|
std::string ConvertToXMLOutputPathSingle(const char* path);
|
2014-02-10 07:48:34 +04:00
|
|
|
void OutputTargetRules(std::ostream& fout, const std::string& configName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* target,
|
|
|
|
const std::string& libName);
|
2014-02-10 07:48:34 +04:00
|
|
|
void OutputBuildTool(std::ostream& fout, const std::string& configName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* t, const Options& targetOptions);
|
2016-02-15 15:02:50 +03:00
|
|
|
void OutputDeploymentDebuggerTool(std::ostream& fout,
|
|
|
|
std::string const& config,
|
|
|
|
cmGeneratorTarget* target);
|
2002-09-04 23:23:56 +04:00
|
|
|
void OutputLibraryDirectories(std::ostream& fout,
|
2008-01-22 17:13:04 +03:00
|
|
|
std::vector<std::string> const& dirs);
|
2016-05-16 17:34:04 +03:00
|
|
|
void WriteProjectSCC(std::ostream& fout, cmGeneratorTarget* target);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteProjectStart(std::ostream& fout, const std::string& libName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* tgt,
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<cmSourceGroup>& sgs);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteProjectStartFortran(std::ostream& fout, const std::string& libName,
|
2015-10-22 19:27:58 +03:00
|
|
|
cmGeneratorTarget* tgt);
|
2016-05-16 17:34:04 +03:00
|
|
|
void WriteVCProjBeginGroup(std::ostream& fout, const char* group,
|
|
|
|
const char* filter);
|
2002-09-04 23:23:56 +04:00
|
|
|
void WriteVCProjEndGroup(std::ostream& fout);
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2002-09-04 23:23:56 +04:00
|
|
|
void WriteCustomRule(std::ostream& fout,
|
2015-05-20 20:55:21 +03:00
|
|
|
std::vector<std::string> const& configs,
|
2016-05-16 17:34:04 +03:00
|
|
|
const char* source, const cmCustomCommand& command,
|
2008-01-14 17:20:58 +03:00
|
|
|
FCInfo& fcinfo);
|
2016-05-16 17:34:04 +03:00
|
|
|
void WriteTargetVersionAttribute(std::ostream& fout, cmGeneratorTarget* gt);
|
2002-09-04 23:23:56 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
bool WriteGroup(const cmSourceGroup* sg, cmGeneratorTarget* target,
|
|
|
|
std::ostream& fout, const std::string& libName,
|
2015-05-20 20:55:21 +03:00
|
|
|
std::vector<std::string> const& configs);
|
2005-07-13 19:21:30 +04:00
|
|
|
|
2008-01-14 17:20:58 +03:00
|
|
|
friend class cmLocalVisualStudio7GeneratorFCInfo;
|
2008-01-22 17:13:04 +03:00
|
|
|
friend class cmLocalVisualStudio7GeneratorInternals;
|
2008-01-14 17:20:58 +03:00
|
|
|
|
2009-06-12 23:28:48 +04:00
|
|
|
class EventWriter;
|
|
|
|
friend class EventWriter;
|
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
std::string ModuleDefinitionFile;
|
2008-04-30 21:26:04 +04:00
|
|
|
bool FortranProject;
|
2012-11-20 15:38:06 +04:00
|
|
|
bool WindowsCEProject;
|
2008-01-22 17:13:04 +03:00
|
|
|
cmLocalVisualStudio7GeneratorInternals* Internal;
|
2002-09-04 23:23:56 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|