cmake/Source/cmGlobalVisualStudio10Generator.h

192 lines
6.7 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2009-10-04 10:30:41 +03:00
#ifndef cmGlobalVisualStudio10Generator_h
#define cmGlobalVisualStudio10Generator_h
#include "cmGlobalVisualStudio8Generator.h"
2017-04-14 19:02:05 +02:00
#include "cmVisualStudio10ToolsetOptions.h"
2009-10-04 10:30:41 +03:00
/** \class cmGlobalVisualStudio10Generator
* \brief Write a Unix makefiles.
*
* cmGlobalVisualStudio10Generator manages UNIX build process for a tree
*/
2016-07-09 11:21:54 +02:00
class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator
2009-10-04 10:30:41 +03:00
{
public:
2015-08-17 11:37:30 +02:00
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
2016-07-09 11:21:54 +02:00
const std::string& platformName);
2013-03-16 19:13:01 +02:00
static cmGlobalGeneratorFactory* NewFactory();
2015-04-27 22:25:09 +02:00
virtual bool MatchesGeneratorName(const std::string& name) const;
2014-08-03 19:52:23 +02:00
2015-04-27 22:25:09 +02:00
virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
2013-03-16 19:13:01 +02:00
2014-08-03 19:52:23 +02:00
virtual void GenerateBuildCommand(
2016-07-09 11:21:54 +02:00
std::vector<std::string>& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
bool verbose,
std::vector<std::string> const& makeOptions = std::vector<std::string>());
2013-03-16 19:13:01 +02:00
2009-10-04 10:30:41 +03:00
///! create the correct local generator
2016-07-09 11:21:54 +02:00
virtual cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf);
2009-10-04 10:30:41 +03:00
/**
2015-04-27 22:25:09 +02:00
* Try to determine system information such as shared library
2013-03-16 19:13:01 +02:00
* extension, pthreads, byte order etc.
2009-10-04 10:30:41 +03:00
*/
2016-07-09 11:21:54 +02:00
virtual void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile*, bool optional);
2009-10-04 10:30:41 +03:00
virtual void WriteSLNHeader(std::ostream& fout);
2017-07-20 19:35:53 +02:00
bool IsCudaEnabled() const { return this->CudaEnabled; }
2015-04-27 22:25:09 +02:00
/** Generating for Nsight Tegra VS plugin? */
bool IsNsightTegra() const;
std::string GetNsightTegraVersion() const;
2013-11-03 12:27:13 +02:00
2011-01-16 11:35:12 +01:00
/** The toolset name for the target platform. */
2015-04-27 22:25:09 +02:00
const char* GetPlatformToolset() const;
2017-04-14 19:02:05 +02:00
std::string const& GetPlatformToolsetString() const;
/** The toolset host architecture name (e.g. x64 for 64-bit host tools). */
const char* GetPlatformToolsetHostArchitecture() const;
2015-04-27 22:25:09 +02:00
2017-07-20 19:35:53 +02:00
/** The cuda toolset version. */
const char* GetPlatformToolsetCuda() const;
std::string const& GetPlatformToolsetCudaString() const;
/** Return whether we need to use No/Debug instead of false/true
for GenerateDebugInformation. */
bool GetPlatformToolsetNeedsDebugEnum() const
{
return this->PlatformToolsetNeedsDebugEnum;
}
2015-04-27 22:25:09 +02:00
/** Return the CMAKE_SYSTEM_NAME. */
std::string const& GetSystemName() const { return this->SystemName; }
/** Return the CMAKE_SYSTEM_VERSION. */
std::string const& GetSystemVersion() const { return this->SystemVersion; }
2015-11-17 17:22:37 +01:00
/** Return the Windows version targeted on VS 2015 and above. */
std::string const& GetWindowsTargetPlatformVersion() const
2016-07-09 11:21:54 +02:00
{
return this->WindowsTargetPlatformVersion;
}
2015-11-17 17:22:37 +01:00
2015-04-27 22:25:09 +02:00
/** Return true if building for WindowsCE */
2016-07-09 11:21:54 +02:00
bool TargetsWindowsCE() const { return this->SystemIsWindowsCE; }
2015-04-27 22:25:09 +02:00
/** Return true if building for WindowsPhone */
2016-07-09 11:21:54 +02:00
bool TargetsWindowsPhone() const { return this->SystemIsWindowsPhone; }
2015-04-27 22:25:09 +02:00
/** Return true if building for WindowsStore */
2016-07-09 11:21:54 +02:00
bool TargetsWindowsStore() const { return this->SystemIsWindowsStore; }
2011-01-16 11:35:12 +01:00
2016-07-09 11:21:54 +02:00
virtual const char* GetCMakeCFGIntDir() const { return "$(Configuration)"; }
2012-02-18 12:40:36 +02:00
bool Find64BitTools(cmMakefile* mf);
2012-06-27 20:52:58 +03:00
/** Generate an <output>.rule file path for a given command output. */
virtual std::string GenerateRuleFile(std::string const& output) const;
2016-03-13 13:35:51 +01:00
void PathTooLong(cmGeneratorTarget* target, cmSourceFile const* sf,
2012-06-27 20:52:58 +03:00
std::string const& sfRel);
2013-11-03 12:27:13 +02:00
virtual const char* GetToolsVersion() { return "4.0"; }
2017-04-14 19:02:05 +02:00
bool FindMakeProgram(cmMakefile* mf) CM_OVERRIDE;
2014-08-03 19:52:23 +02:00
2015-04-27 22:25:09 +02:00
static std::string GetInstalledNsightTegraVersion();
2017-04-14 19:02:05 +02:00
cmIDEFlagTable const* GetClFlagTable() const;
cmIDEFlagTable const* GetCSharpFlagTable() const;
cmIDEFlagTable const* GetRcFlagTable() const;
cmIDEFlagTable const* GetLibFlagTable() const;
cmIDEFlagTable const* GetLinkFlagTable() const;
2017-07-20 19:35:53 +02:00
cmIDEFlagTable const* GetCudaFlagTable() const;
cmIDEFlagTable const* GetCudaHostFlagTable() const;
2017-04-14 19:02:05 +02:00
cmIDEFlagTable const* GetMasmFlagTable() const;
2017-07-20 19:35:53 +02:00
cmIDEFlagTable const* GetNasmFlagTable() const;
2017-04-14 19:02:05 +02:00
2009-10-04 10:30:41 +03:00
protected:
2015-04-27 22:25:09 +02:00
virtual void Generate();
virtual bool InitializeSystem(cmMakefile* mf);
2015-11-17 17:22:37 +01:00
virtual bool InitializeWindows(cmMakefile* mf);
2015-04-27 22:25:09 +02:00
virtual bool InitializeWindowsCE(cmMakefile* mf);
virtual bool InitializeWindowsPhone(cmMakefile* mf);
virtual bool InitializeWindowsStore(cmMakefile* mf);
2017-07-20 19:35:53 +02:00
virtual bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value);
2015-04-27 22:25:09 +02:00
virtual std::string SelectWindowsCEToolset() const;
virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
2009-10-04 10:30:41 +03:00
virtual const char* GetIDEVersion() { return "10.0"; }
2011-01-16 11:35:12 +01:00
2014-08-03 19:52:23 +02:00
std::string const& GetMSBuildCommand();
2015-04-27 22:25:09 +02:00
std::string GeneratorToolset;
2017-04-14 19:02:05 +02:00
std::string GeneratorToolsetHostArchitecture;
2017-07-20 19:35:53 +02:00
std::string GeneratorToolsetCuda;
2015-04-27 22:25:09 +02:00
std::string DefaultPlatformToolset;
2015-11-17 17:22:37 +01:00
std::string WindowsTargetPlatformVersion;
2015-04-27 22:25:09 +02:00
std::string SystemName;
std::string SystemVersion;
std::string NsightTegraVersion;
2017-04-14 19:02:05 +02:00
cmIDEFlagTable const* DefaultClFlagTable;
cmIDEFlagTable const* DefaultCSharpFlagTable;
cmIDEFlagTable const* DefaultLibFlagTable;
cmIDEFlagTable const* DefaultLinkFlagTable;
2017-07-20 19:35:53 +02:00
cmIDEFlagTable const* DefaultCudaFlagTable;
cmIDEFlagTable const* DefaultCudaHostFlagTable;
2017-04-14 19:02:05 +02:00
cmIDEFlagTable const* DefaultMasmFlagTable;
2017-07-20 19:35:53 +02:00
cmIDEFlagTable const* DefaultNasmFlagTable;
2017-04-14 19:02:05 +02:00
cmIDEFlagTable const* DefaultRcFlagTable;
2015-04-27 22:25:09 +02:00
bool SystemIsWindowsCE;
bool SystemIsWindowsPhone;
bool SystemIsWindowsStore;
2012-06-27 20:52:58 +03:00
private:
2013-03-16 19:13:01 +02:00
class Factory;
2012-06-27 20:52:58 +03:00
struct LongestSourcePath
{
2016-07-09 11:21:54 +02:00
LongestSourcePath()
: Length(0)
, Target(0)
, SourceFile(0)
{
}
2012-06-27 20:52:58 +03:00
size_t Length;
2016-03-13 13:35:51 +01:00
cmGeneratorTarget* Target;
2015-04-27 22:25:09 +02:00
cmSourceFile const* SourceFile;
2012-06-27 20:52:58 +03:00
std::string SourceRel;
};
LongestSourcePath LongestSource;
2014-08-03 19:52:23 +02:00
std::string MSBuildCommand;
bool MSBuildCommandInitialized;
2017-04-14 19:02:05 +02:00
cmVisualStudio10ToolsetOptions ToolsetOptions;
2014-08-03 19:52:23 +02:00
virtual std::string FindMSBuildCommand();
virtual std::string FindDevEnvCommand();
virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
2015-08-17 11:37:30 +02:00
2017-07-20 19:35:53 +02:00
bool PlatformToolsetNeedsDebugEnum;
bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf);
std::string VCTargetsPath;
bool FindVCTargetsPath(cmMakefile* mf);
bool CudaEnabled;
2015-08-17 11:37:30 +02:00
// We do not use the reload macros for VS >= 10.
virtual std::string GetUserMacrosDirectory() { return ""; }
2009-10-04 10:30:41 +03:00
};
#endif