2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2002-09-04 23:23:56 +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.
|
2002-09-04 23:23:56 +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.
|
|
|
|
============================================================================*/
|
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"
|
2009-07-29 19:28:55 +04:00
|
|
|
#include "cmVisualStudioGeneratorOptions.h"
|
2002-09-04 23:23:56 +04:00
|
|
|
|
|
|
|
class cmTarget;
|
|
|
|
class cmSourceFile;
|
2003-06-03 18:30:23 +04:00
|
|
|
class cmCustomCommand;
|
|
|
|
class cmSourceGroup;
|
2009-06-26 00:41:57 +04:00
|
|
|
|
2002-09-04 23:23:56 +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-05-17 12:33:09 +03:00
|
|
|
cmLocalVisualStudio7Generator(cmGlobalGenerator* gg,
|
2015-05-03 17:50:34 +03:00
|
|
|
cmLocalGenerator* parent);
|
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
|
|
|
|
|
|
|
enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specify the type of the build: static, dll, or executable.
|
|
|
|
*/
|
2014-02-22 04:05:55 +04:00
|
|
|
void SetBuildType(BuildType,const std::string& name);
|
2002-09-04 23:23:56 +04:00
|
|
|
|
2009-06-26 00:41:57 +04:00
|
|
|
virtual std::string GetTargetDirectory(cmTarget const&) const;
|
|
|
|
cmSourceFile* CreateVCProjBuildRule();
|
|
|
|
void WriteStampFiles();
|
2012-03-07 23:04:33 +04:00
|
|
|
virtual std::string ComputeLongestObjectDirectory(cmTarget&) 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();
|
2011-07-09 01:08:43 +04:00
|
|
|
protected:
|
2014-02-08 00:40:05 +04:00
|
|
|
void CreateSingleVCProj(const std::string& lname, cmTarget &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,
|
2005-06-22 17:06:46 +04:00
|
|
|
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
|
2011-07-29 18:04:36 +04:00
|
|
|
void WriteVCProjFooter(std::ostream& fout, cmTarget &target);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteVCProjFile(std::ostream& fout, const std::string& libName,
|
2002-09-04 23:23:56 +04:00
|
|
|
cmTarget &tgt);
|
|
|
|
void WriteConfigurations(std::ostream& fout,
|
2015-05-20 20:55:21 +03:00
|
|
|
std::vector<std::string> const& configs,
|
2014-02-07 02:31:47 +04:00
|
|
|
const std::string& libName, cmTarget &tgt);
|
2002-09-04 23:23:56 +04:00
|
|
|
void WriteConfiguration(std::ostream& fout,
|
2014-02-10 07:48:34 +04:00
|
|
|
const std::string& configName,
|
2014-02-07 02:31:47 +04:00
|
|
|
const std::string& libName, cmTarget &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,
|
2014-02-07 02:31:47 +04:00
|
|
|
cmTarget &target, const std::string& libName);
|
2014-02-10 07:48:34 +04:00
|
|
|
void OutputBuildTool(std::ostream& fout, const std::string& configName,
|
2013-08-05 23:23:13 +04:00
|
|
|
cmTarget& t, const Options& targetOptions);
|
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);
|
2011-01-17 23:41:24 +03:00
|
|
|
void WriteProjectSCC(std::ostream& fout, cmTarget& target);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteProjectStart(std::ostream& fout, const std::string& libName,
|
2005-06-22 17:06:46 +04:00
|
|
|
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
|
2014-02-07 02:31:47 +04:00
|
|
|
void WriteProjectStartFortran(std::ostream& fout, const std::string& libName,
|
2008-04-30 21:26:04 +04:00
|
|
|
cmTarget &tgt);
|
2012-08-13 21:42:58 +04:00
|
|
|
void WriteVCProjBeginGroup(std::ostream& fout,
|
2002-10-24 02:03:27 +04:00
|
|
|
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,
|
2002-09-04 23:23:56 +04:00
|
|
|
const char* source,
|
2007-05-09 16:25:45 +04:00
|
|
|
const cmCustomCommand& command,
|
2008-01-14 17:20:58 +03:00
|
|
|
FCInfo& fcinfo);
|
2006-10-17 02:17:14 +04:00
|
|
|
void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
|
2002-09-04 23:23:56 +04:00
|
|
|
|
2013-02-04 13:35:48 +04:00
|
|
|
bool WriteGroup(const cmSourceGroup *sg,
|
2008-01-30 01:30:34 +03:00
|
|
|
cmTarget& target, std::ostream &fout,
|
2014-02-07 02:31:47 +04:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2007-03-12 19:35:11 +03:00
|
|
|
|
2002-09-04 23:23:56 +04:00
|
|
|
#endif
|
|
|
|
|