Use cmGeneratorTarget for property access.

This commit is contained in:
Stephen Kelly 2015-10-10 15:51:21 +02:00
parent b857f0d84b
commit cfb2f7508a
8 changed files with 81 additions and 70 deletions

View File

@ -109,7 +109,7 @@ std::string cmCommonTargetGenerator::ComputeFortranModuleDirectory() const
{ {
std::string mod_dir; std::string mod_dir;
const char* target_mod_dir = const char* target_mod_dir =
this->Target->GetProperty("Fortran_MODULE_DIRECTORY"); this->GeneratorTarget->GetProperty("Fortran_MODULE_DIRECTORY");
const char* moddir_flag = const char* moddir_flag =
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
if(target_mod_dir && moddir_flag) if(target_mod_dir && moddir_flag)
@ -214,7 +214,7 @@ cmCommonTargetGenerator
this->LocalGenerator->GetFortranFormat(srcfmt); this->LocalGenerator->GetFortranFormat(srcfmt);
if(format == cmLocalGenerator::FortranFormatNone) if(format == cmLocalGenerator::FortranFormatNone)
{ {
const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT"); const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT");
format = this->LocalGenerator->GetFortranFormat(tgtfmt); format = this->LocalGenerator->GetFortranFormat(tgtfmt);
} }
const char* var = 0; const char* var = 0;

View File

@ -4859,7 +4859,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Skip per-configuration subdirectory. // Skip per-configuration subdirectory.
conf = ""; conf = "";
} }
else if(const char* outdir = this->Target->GetProperty(propertyName)) else if(const char* outdir = this->GetProperty(propertyName))
{ {
// Use the user-specified output directory. // Use the user-specified output directory.
cmGeneratorExpression ge; cmGeneratorExpression ge;

View File

@ -197,7 +197,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->ConfigName); this->ConfigName);
if(this->Target->GetPropertyAsBool("WIN32_EXECUTABLE")) if(this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE"))
{ {
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE")); (linkFlags, this->Makefile->GetDefinition("CMAKE_CREATE_WIN32_EXE"));
@ -226,11 +226,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Add target-specific linker flags. // Add target-specific linker flags.
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(linkFlags, this->Target->GetProperty("LINK_FLAGS")); (linkFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_"; std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName); linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(linkFlags, this->Target->GetProperty(linkFlagsConfig)); (linkFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->AddModuleDefinitionFlag(linkFlags); this->AddModuleDefinitionFlag(linkFlags);

View File

@ -166,11 +166,11 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
std::string extraFlags; std::string extraFlags;
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty("LINK_FLAGS")); (extraFlags, this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_"; std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName); linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig)); (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName); (extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
@ -190,11 +190,11 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
std::string extraFlags; std::string extraFlags;
this->LocalGenerator->AppendFlags(extraFlags, this->LocalGenerator->AppendFlags(extraFlags,
this->Target->GetProperty("LINK_FLAGS")); this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_"; std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName); linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig)); (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MODULE_LINKER_FLAGS", this->ConfigName); (extraFlags, "CMAKE_MODULE_LINKER_FLAGS", this->ConfigName);
this->AddModuleDefinitionFlag(extraFlags); this->AddModuleDefinitionFlag(extraFlags);
@ -213,11 +213,11 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
std::string extraFlags; std::string extraFlags;
this->LocalGenerator->AppendFlags(extraFlags, this->LocalGenerator->AppendFlags(extraFlags,
this->Target->GetProperty("LINK_FLAGS")); this->GeneratorTarget->GetProperty("LINK_FLAGS"));
std::string linkFlagsConfig = "LINK_FLAGS_"; std::string linkFlagsConfig = "LINK_FLAGS_";
linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName); linkFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
this->LocalGenerator->AppendFlags this->LocalGenerator->AppendFlags
(extraFlags, this->Target->GetProperty(linkFlagsConfig)); (extraFlags, this->GeneratorTarget->GetProperty(linkFlagsConfig));
this->LocalGenerator->AddConfigVariableFlags this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS", this->ConfigName); (extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS", this->ConfigName);
@ -569,7 +569,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if(this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
std::string name_of_def_file = std::string name_of_def_file =
this->GeneratorTarget->GetSupportDirectory(); this->GeneratorTarget->GetSupportDirectory();

View File

@ -667,7 +667,7 @@ cmMakefileTargetGenerator
if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
{ {
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE"; std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
const char *iwyu = this->Target->GetProperty(iwyu_prop); const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (iwyu && *iwyu) if (iwyu && *iwyu)
{ {
std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu --iwyu="; std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu --iwyu=";
@ -681,7 +681,7 @@ cmMakefileTargetGenerator
if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) if (!compileCommands.empty() && (lang == "C" || lang == "CXX"))
{ {
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER"; std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char *clauncher = this->Target->GetProperty(clauncher_prop); const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
if (clauncher && *clauncher) if (clauncher && *clauncher)
{ {
std::vector<std::string> launcher_cmd; std::vector<std::string> launcher_cmd;
@ -1513,7 +1513,7 @@ void cmMakefileTargetGenerator
// Add user-specified dependencies. // Add user-specified dependencies.
if(const char* linkDepends = if(const char* linkDepends =
this->Target->GetProperty("LINK_DEPENDS")) this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
{ {
cmSystemTools::ExpandListArgument(linkDepends, depends); cmSystemTools::ExpandListArgument(linkDepends, depends);
} }

View File

@ -218,7 +218,8 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
} }
// Add user-specified dependencies. // Add user-specified dependencies.
if (const char* linkDepends = this->Target->GetProperty("LINK_DEPENDS")) if (const char* linkDepends =
this->GeneratorTarget->GetProperty("LINK_DEPENDS"))
{ {
std::vector<std::string> linkDeps; std::vector<std::string> linkDeps;
cmSystemTools::ExpandListArgument(linkDepends, linkDeps); cmSystemTools::ExpandListArgument(linkDepends, linkDeps);
@ -410,7 +411,7 @@ cmNinjaTargetGenerator
if (!compileCmds.empty() && (lang == "C" || lang == "CXX")) if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
{ {
std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE"; std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
const char *iwyu = this->Target->GetProperty(iwyu_prop); const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
if (iwyu && *iwyu) if (iwyu && *iwyu)
{ {
std::string run_iwyu = std::string run_iwyu =
@ -427,7 +428,7 @@ cmNinjaTargetGenerator
if (!compileCmds.empty() && (lang == "C" || lang == "CXX")) if (!compileCmds.empty() && (lang == "C" || lang == "CXX"))
{ {
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER"; std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
const char *clauncher = this->Target->GetProperty(clauncher_prop); const char *clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
if (clauncher && *clauncher) if (clauncher && *clauncher)
{ {
std::vector<std::string> launcher_cmd; std::vector<std::string> launcher_cmd;

View File

@ -90,7 +90,8 @@ void cmNinjaUtilityTargetGenerator::Generate()
} else { } else {
std::string command = std::string command =
this->GetLocalGenerator()->BuildCommandLine(commands); this->GetLocalGenerator()->BuildCommandLine(commands);
const char *echoStr = this->GetTarget()->GetProperty("EchoString"); const char *echoStr =
this->GetGeneratorTarget()->GetProperty("EchoString");
std::string desc; std::string desc;
if (echoStr) if (echoStr)
desc = echoStr; desc = echoStr;

View File

@ -270,7 +270,7 @@ void cmVisualStudio10TargetGenerator::Generate()
{ {
// do not generate external ms projects // do not generate external ms projects
if(this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY if(this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY
|| this->Target->GetProperty("EXTERNAL_MSPROJECT")) || this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT"))
{ {
return; return;
} }
@ -368,7 +368,7 @@ void cmVisualStudio10TargetGenerator::Generate()
} }
const char* vsProjectTypes = const char* vsProjectTypes =
this->Target->GetProperty("VS_GLOBAL_PROJECT_TYPES"); this->GeneratorTarget->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if(vsProjectTypes) if(vsProjectTypes)
{ {
this->WriteString("<ProjectTypes>", 2); this->WriteString("<ProjectTypes>", 2);
@ -376,9 +376,12 @@ void cmVisualStudio10TargetGenerator::Generate()
"</ProjectTypes>\n"; "</ProjectTypes>\n";
} }
const char* vsProjectName = this->Target->GetProperty("VS_SCC_PROJECTNAME"); const char* vsProjectName =
const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH"); this->GeneratorTarget->GetProperty("VS_SCC_PROJECTNAME");
const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER"); const char* vsLocalPath =
this->GeneratorTarget->GetProperty("VS_SCC_LOCALPATH");
const char* vsProvider =
this->GeneratorTarget->GetProperty("VS_SCC_PROVIDER");
if( vsProjectName && vsLocalPath && vsProvider ) if( vsProjectName && vsLocalPath && vsProvider )
{ {
@ -392,7 +395,8 @@ void cmVisualStudio10TargetGenerator::Generate()
(*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) << (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) <<
"</SccProvider>\n"; "</SccProvider>\n";
const char* vsAuxPath = this->Target->GetProperty("VS_SCC_AUXPATH"); const char* vsAuxPath =
this->GeneratorTarget->GetProperty("VS_SCC_AUXPATH");
if( vsAuxPath ) if( vsAuxPath )
{ {
this->WriteString("<SccAuxPath>", 2); this->WriteString("<SccAuxPath>", 2);
@ -401,13 +405,13 @@ void cmVisualStudio10TargetGenerator::Generate()
} }
} }
if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT")) if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT"))
{ {
this->WriteString("<WinMDAssembly>true</WinMDAssembly>\n", 2); this->WriteString("<WinMDAssembly>true</WinMDAssembly>\n", 2);
} }
const char* vsGlobalKeyword = const char* vsGlobalKeyword =
this->Target->GetProperty("VS_GLOBAL_KEYWORD"); this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD");
if(!vsGlobalKeyword) if(!vsGlobalKeyword)
{ {
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2); this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
@ -420,7 +424,7 @@ void cmVisualStudio10TargetGenerator::Generate()
} }
const char* vsGlobalRootNamespace = const char* vsGlobalRootNamespace =
this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE"); this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
if(vsGlobalRootNamespace) if(vsGlobalRootNamespace)
{ {
this->WriteString("<RootNamespace>", 2); this->WriteString("<RootNamespace>", 2);
@ -431,14 +435,14 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<Platform>", 2); this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(this->Platform) (*this->BuildFileStream) << cmVS10EscapeXML(this->Platform)
<< "</Platform>\n"; << "</Platform>\n";
const char* projLabel = this->Target->GetProperty("PROJECT_LABEL"); const char* projLabel = this->GeneratorTarget->GetProperty("PROJECT_LABEL");
if(!projLabel) if(!projLabel)
{ {
projLabel = this->Name.c_str(); projLabel = this->Name.c_str();
} }
this->WriteString("<ProjectName>", 2); this->WriteString("<ProjectName>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(projLabel) << "</ProjectName>\n"; (*this->BuildFileStream) << cmVS10EscapeXML(projLabel) << "</ProjectName>\n";
if(const char* targetFrameworkVersion = this->Target->GetProperty( if(const char* targetFrameworkVersion = this->GeneratorTarget->GetProperty(
"VS_DOTNET_TARGET_FRAMEWORK_VERSION")) "VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
{ {
this->WriteString("<TargetFrameworkVersion>", 2); this->WriteString("<TargetFrameworkVersion>", 2);
@ -497,7 +501,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
{ {
std::vector<std::string> references; std::vector<std::string> references;
if(const char* vsDotNetReferences = if(const char* vsDotNetReferences =
this->Target->GetProperty("VS_DOTNET_REFERENCES")) this->GeneratorTarget->GetProperty("VS_DOTNET_REFERENCES"))
{ {
cmSystemTools::ExpandListArgument(vsDotNetReferences, references); cmSystemTools::ExpandListArgument(vsDotNetReferences, references);
} }
@ -543,7 +547,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
i != this->Configurations.end(); ++i) i != this->Configurations.end(); ++i)
{ {
this->WritePlatformConfigTag("LogicalName", i->c_str(), 3); this->WritePlatformConfigTag("LogicalName", i->c_str(), 3);
if(this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE")) if(this->GeneratorTarget->GetProperty("VS_GLOBAL_ROOTNAMESPACE"))
{ {
(*this->BuildFileStream ) << "$(RootNamespace)."; (*this->BuildFileStream ) << "$(RootNamespace).";
} }
@ -610,7 +614,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
{ {
std::vector<std::string> references; std::vector<std::string> references;
if(const char* vsWinRTReferences = if(const char* vsWinRTReferences =
this->Target->GetProperty("VS_WINRT_REFERENCES")) this->GeneratorTarget->GetProperty("VS_WINRT_REFERENCES"))
{ {
cmSystemTools::ExpandListArgument(vsWinRTReferences, references); cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
} }
@ -679,7 +683,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
break; break;
case cmState::EXECUTABLE: case cmState::EXECUTABLE:
if(this->NsightTegra && if(this->NsightTegra &&
!this->Target->GetPropertyAsBool("ANDROID_GUI")) !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
{ {
// Android executables are .so too. // Android executables are .so too.
configType += "DynamicLibrary"; configType += "DynamicLibrary";
@ -746,10 +750,10 @@ void cmVisualStudio10TargetGenerator
if((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY && if((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY &&
this->ClOptions[config]->UsingUnicode()) || this->ClOptions[config]->UsingUnicode()) ||
this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") || this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
this->GlobalGenerator->TargetsWindowsPhone() || this->GlobalGenerator->TargetsWindowsPhone() ||
this->GlobalGenerator->TargetsWindowsStore() || this->GlobalGenerator->TargetsWindowsStore() ||
this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
{ {
this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2); this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
} }
@ -769,8 +773,8 @@ void cmVisualStudio10TargetGenerator
pts += "</PlatformToolset>\n"; pts += "</PlatformToolset>\n";
this->WriteString(pts.c_str(), 2); this->WriteString(pts.c_str(), 2);
} }
if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") || if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
{ {
this->WriteString("<WindowsAppContainer>true" this->WriteString("<WindowsAppContainer>true"
"</WindowsAppContainer>\n", 2); "</WindowsAppContainer>\n", 2);
@ -788,27 +792,29 @@ void cmVisualStudio10TargetGenerator
ntv += toolset? toolset : "Default"; ntv += toolset? toolset : "Default";
ntv += "</NdkToolchainVersion>\n"; ntv += "</NdkToolchainVersion>\n";
this->WriteString(ntv.c_str(), 2); this->WriteString(ntv.c_str(), 2);
if(const char* minApi = this->Target->GetProperty("ANDROID_API_MIN")) if(const char* minApi =
this->GeneratorTarget->GetProperty("ANDROID_API_MIN"))
{ {
this->WriteString("<AndroidMinAPI>", 2); this->WriteString("<AndroidMinAPI>", 2);
(*this->BuildFileStream ) << (*this->BuildFileStream ) <<
"android-" << cmVS10EscapeXML(minApi) << "</AndroidMinAPI>\n"; "android-" << cmVS10EscapeXML(minApi) << "</AndroidMinAPI>\n";
} }
if(const char* api = this->Target->GetProperty("ANDROID_API")) if(const char* api = this->GeneratorTarget->GetProperty("ANDROID_API"))
{ {
this->WriteString("<AndroidTargetAPI>", 2); this->WriteString("<AndroidTargetAPI>", 2);
(*this->BuildFileStream ) << (*this->BuildFileStream ) <<
"android-" << cmVS10EscapeXML(api) << "</AndroidTargetAPI>\n"; "android-" << cmVS10EscapeXML(api) << "</AndroidTargetAPI>\n";
} }
if(const char* cpuArch = this->Target->GetProperty("ANDROID_ARCH")) if(const char* cpuArch = this->GeneratorTarget->GetProperty("ANDROID_ARCH"))
{ {
this->WriteString("<AndroidArch>", 2); this->WriteString("<AndroidArch>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(cpuArch) << (*this->BuildFileStream) << cmVS10EscapeXML(cpuArch) <<
"</AndroidArch>\n"; "</AndroidArch>\n";
} }
if(const char* stlType = this->Target->GetProperty("ANDROID_STL_TYPE")) if(const char* stlType =
this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE"))
{ {
this->WriteString("<AndroidStlType>", 2); this->WriteString("<AndroidStlType>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(stlType) << (*this->BuildFileStream) << cmVS10EscapeXML(stlType) <<
@ -1963,7 +1969,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
if (this->MSTools) if (this->MSTools)
{ {
// If we have the VS_WINRT_COMPONENT set then force Compile as WinRT. // If we have the VS_WINRT_COMPONENT set then force Compile as WinRT.
if (this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT")) if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT"))
{ {
clOptions.AddFlag("CompileAsWinRT", "true"); clOptions.AddFlag("CompileAsWinRT", "true");
// For WinRT components, add the _WINRT_DLL define to produce a lib // For WinRT components, add the _WINRT_DLL define to produce a lib
@ -2012,7 +2018,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
if(this->NsightTegra) if(this->NsightTegra)
{ {
if(const char* processMax = if(const char* processMax =
this->Target->GetProperty("ANDROID_PROCESS_MAX")) this->GeneratorTarget->GetProperty("ANDROID_PROCESS_MAX"))
{ {
this->WriteString("<ProcessMax>", 3); this->WriteString("<ProcessMax>", 3);
*this->BuildFileStream << cmVS10EscapeXML(processMax) << *this->BuildFileStream << cmVS10EscapeXML(processMax) <<
@ -2270,18 +2276,18 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
cmVS10EscapeXML(antBuildPath) << "</AntBuildPath>\n"; cmVS10EscapeXML(antBuildPath) << "</AntBuildPath>\n";
} }
if (this->Target->GetPropertyAsBool("ANDROID_SKIP_ANT_STEP")) if (this->GeneratorTarget->GetPropertyAsBool("ANDROID_SKIP_ANT_STEP"))
{ {
this->WriteString("<SkipAntStep>true</SkipAntStep>\n", 3); this->WriteString("<SkipAntStep>true</SkipAntStep>\n", 3);
} }
if (this->Target->GetPropertyAsBool("ANDROID_PROGUARD")) if (this->GeneratorTarget->GetPropertyAsBool("ANDROID_PROGUARD"))
{ {
this->WriteString("<EnableProGuard>true</EnableProGuard>\n", 3); this->WriteString("<EnableProGuard>true</EnableProGuard>\n", 3);
} }
if (const char* proGuardConfigLocation = if (const char* proGuardConfigLocation =
this->Target->GetProperty("ANDROID_PROGUARD_CONFIG_PATH")) this->GeneratorTarget->GetProperty("ANDROID_PROGUARD_CONFIG_PATH"))
{ {
this->WriteString("<ProGuardConfigLocation>", 3); this->WriteString("<ProGuardConfigLocation>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(proGuardConfigLocation) << (*this->BuildFileStream) << cmVS10EscapeXML(proGuardConfigLocation) <<
@ -2289,7 +2295,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* securePropertiesLocation = if (const char* securePropertiesLocation =
this->Target->GetProperty("ANDROID_SECURE_PROPS_PATH")) this->GeneratorTarget->GetProperty("ANDROID_SECURE_PROPS_PATH"))
{ {
this->WriteString("<SecurePropertiesLocation>", 3); this->WriteString("<SecurePropertiesLocation>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(securePropertiesLocation) << (*this->BuildFileStream) << cmVS10EscapeXML(securePropertiesLocation) <<
@ -2297,7 +2303,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* nativeLibDirectoriesExpression = if (const char* nativeLibDirectoriesExpression =
this->Target->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES")) this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES"))
{ {
cmGeneratorExpression ge; cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@ -2310,7 +2316,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* nativeLibDependenciesExpression = if (const char* nativeLibDependenciesExpression =
this->Target->GetProperty("ANDROID_NATIVE_LIB_DEPENDENCIES")) this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DEPENDENCIES"))
{ {
cmGeneratorExpression ge; cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@ -2323,7 +2329,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* javaSourceDir = if (const char* javaSourceDir =
this->Target->GetProperty("ANDROID_JAVA_SOURCE_DIR")) this->GeneratorTarget->GetProperty("ANDROID_JAVA_SOURCE_DIR"))
{ {
this->WriteString("<JavaSourceDir>", 3); this->WriteString("<JavaSourceDir>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(javaSourceDir) << (*this->BuildFileStream) << cmVS10EscapeXML(javaSourceDir) <<
@ -2331,7 +2337,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* jarDirectoriesExpression = if (const char* jarDirectoriesExpression =
this->Target->GetProperty("ANDROID_JAR_DIRECTORIES")) this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES"))
{ {
cmGeneratorExpression ge; cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@ -2344,7 +2350,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* jarDeps = if (const char* jarDeps =
this->Target->GetProperty("ANDROID_JAR_DEPENDENCIES")) this->GeneratorTarget->GetProperty("ANDROID_JAR_DEPENDENCIES"))
{ {
this->WriteString("<JarDependencies>", 3); this->WriteString("<JarDependencies>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(jarDeps) << (*this->BuildFileStream) << cmVS10EscapeXML(jarDeps) <<
@ -2352,7 +2358,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* assetsDirectories = if (const char* assetsDirectories =
this->Target->GetProperty("ANDROID_ASSETS_DIRECTORIES")) this->GeneratorTarget->GetProperty("ANDROID_ASSETS_DIRECTORIES"))
{ {
this->WriteString("<AssetsDirectories>", 3); this->WriteString("<AssetsDirectories>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(assetsDirectories) << (*this->BuildFileStream) << cmVS10EscapeXML(assetsDirectories) <<
@ -2368,7 +2374,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
} }
if (const char* antAdditionalOptions = if (const char* antAdditionalOptions =
this->Target->GetProperty("ANDROID_ANT_ADDITIONAL_OPTIONS")) this->GeneratorTarget->GetProperty("ANDROID_ANT_ADDITIONAL_OPTIONS"))
{ {
this->WriteString("<AdditionalOptions>", 3); this->WriteString("<AdditionalOptions>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(antAdditionalOptions) << (*this->BuildFileStream) << cmVS10EscapeXML(antAdditionalOptions) <<
@ -2439,7 +2445,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
flags += " "; flags += " ";
flags += this-> flags += this->
Target->GetMakefile()->GetRequiredDefinition(linkFlagVar.c_str()); Target->GetMakefile()->GetRequiredDefinition(linkFlagVar.c_str());
const char* targetLinkFlags = this->Target->GetProperty("LINK_FLAGS"); const char* targetLinkFlags =
this->GeneratorTarget->GetProperty("LINK_FLAGS");
if(targetLinkFlags) if(targetLinkFlags)
{ {
flags += " "; flags += " ";
@ -2447,7 +2454,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
} }
std::string flagsProp = "LINK_FLAGS_"; std::string flagsProp = "LINK_FLAGS_";
flagsProp += CONFIG; flagsProp += CONFIG;
if(const char* flagsConfig = this->Target->GetProperty(flagsProp.c_str())) if(const char* flagsConfig =
this->GeneratorTarget->GetProperty(flagsProp.c_str()))
{ {
flags += " "; flags += " ";
flags += flagsConfig; flags += flagsConfig;
@ -2525,7 +2533,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
{ {
linkOptions.AddFlag("Version", ""); linkOptions.AddFlag("Version", "");
if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") ) if ( this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE") )
{ {
if (this->GlobalGenerator->TargetsWindowsCE()) if (this->GlobalGenerator->TargetsWindowsCE())
{ {
@ -2597,7 +2605,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
// A Windows Runtime component uses internal .NET metadata, // A Windows Runtime component uses internal .NET metadata,
// so does not have an import library. // so does not have an import library.
if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") && if(this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
this->GeneratorTarget->GetType() != cmState::EXECUTABLE) this->GeneratorTarget->GetType() != cmState::EXECUTABLE)
{ {
linkOptions.AddFlag("GenerateWindowsMetadata", "true"); linkOptions.AddFlag("GenerateWindowsMetadata", "true");
@ -2639,7 +2647,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)exportall.def"); linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)exportall.def");
} }
@ -2783,7 +2791,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
this->WriteManifestOptions(*i); this->WriteManifestOptions(*i);
if(this->NsightTegra && if(this->NsightTegra &&
this->GeneratorTarget->GetType() == cmState::EXECUTABLE && this->GeneratorTarget->GetType() == cmState::EXECUTABLE &&
this->Target->GetPropertyAsBool("ANDROID_GUI")) this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI"))
{ {
this->WriteAntBuildOptions(*i); this->WriteAntBuildOptions(*i);
} }
@ -2798,7 +2806,7 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY &&
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) if (this->GeneratorTarget->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{ {
addedPrelink = true; addedPrelink = true;
std::vector<cmCustomCommand> commands = std::vector<cmCustomCommand> commands =
@ -2911,14 +2919,14 @@ void cmVisualStudio10TargetGenerator::WritePlatformExtensions()
cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
{ {
const char* desktopExtensionsVersion = const char* desktopExtensionsVersion =
this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION"); this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
if (desktopExtensionsVersion) if (desktopExtensionsVersion)
{ {
this->WriteSinglePlatformExtension("WindowsDesktop", this->WriteSinglePlatformExtension("WindowsDesktop",
desktopExtensionsVersion); desktopExtensionsVersion);
} }
const char* mobileExtensionsVersion = const char* mobileExtensionsVersion =
this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION"); this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
if (mobileExtensionsVersion) if (mobileExtensionsVersion)
{ {
this->WriteSinglePlatformExtension("WindowsMobile", this->WriteSinglePlatformExtension("WindowsMobile",
@ -2958,11 +2966,11 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0"))
{ {
const char* desktopExtensionsVersion = const char* desktopExtensionsVersion =
this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION"); this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
const char* mobileExtensionsVersion = const char* mobileExtensionsVersion =
this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION"); this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
const char* iotExtensionsVersion = const char* iotExtensionsVersion =
this->Target->GetProperty("VS_IOT_EXTENSIONS_VERSION"); this->GeneratorTarget->GetProperty("VS_IOT_EXTENSIONS_VERSION");
if(desktopExtensionsVersion || mobileExtensionsVersion || if(desktopExtensionsVersion || mobileExtensionsVersion ||
iotExtensionsVersion) iotExtensionsVersion)
@ -3194,7 +3202,8 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
"</WindowsTargetPlatformVersion>\n"; "</WindowsTargetPlatformVersion>\n";
} }
const char* targetPlatformMinVersion = const char* targetPlatformMinVersion =
this->Target->GetProperty("VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION"); this->GeneratorTarget
->GetProperty("VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION");
if(targetPlatformMinVersion) if(targetPlatformMinVersion)
{ {
this->WriteString("<WindowsTargetPlatformMinVersion>", 2); this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
@ -3213,7 +3222,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
} }
// Added IoT Startup Task support // Added IoT Startup Task support
if(this->Target->GetPropertyAsBool("VS_IOT_STARTUP_TASK")) if(this->GeneratorTarget->GetPropertyAsBool("VS_IOT_STARTUP_TASK"))
{ {
this->WriteString("<ContainsStartupTask>true</ContainsStartupTask>\n", 2); this->WriteString("<ContainsStartupTask>true</ContainsStartupTask>\n", 2);
} }