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