diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-11-21 15:05:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-29 14:31:30 (GMT) |
commit | e390991846825799e619e072a28f1da58b7c89ba (patch) | |
tree | c311f84f4df2a5e55cf667fe505e243de45c9258 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 1528831bb1330cc539004f9fb3068e871f109d34 (diff) | |
download | CMake-e390991846825799e619e072a28f1da58b7c89ba.zip CMake-e390991846825799e619e072a28f1da58b7c89ba.tar.gz CMake-e390991846825799e619e072a28f1da58b7c89ba.tar.bz2 |
VS: Add option to customize vcxproj user props file
Add a `VS_USER_PROPS_CXX` target property to set the user props file of
the generated `.vcxproj` file to be something other than the default
`$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props`.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4dabd51..5b99007 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -139,7 +139,11 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line, (*this->BuildFileStream) << line; } -#define VS10_USER_PROPS "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" +#define VS10_CXX_DEFAULT_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.Default.props" +#define VS10_CXX_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.props" +#define VS10_CXX_USER_PROPS \ + "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" +#define VS10_CXX_TARGETS "$(VCTargetsPath)\\Microsoft.Cpp.targets" void cmVisualStudio10TargetGenerator::Generate() { @@ -345,12 +349,9 @@ void cmVisualStudio10TargetGenerator::Generate() } this->WriteString("</PropertyGroup>\n", 1); - this->WriteString("<Import Project=" - "\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n", - 1); + this->WriteString("<Import Project=\"" VS10_CXX_DEFAULT_PROPS "\" />\n", 1); this->WriteProjectConfigurationValues(); - this->WriteString( - "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n", 1); + this->WriteString("<Import Project=\"" VS10_CXX_PROPS "\" />\n", 1); this->WriteString("<ImportGroup Label=\"ExtensionSettings\">\n", 1); if (this->GlobalGenerator->IsMasmEnabled()) { this->WriteString("<Import Project=\"$(VCTargetsPath)\\" @@ -359,10 +360,19 @@ void cmVisualStudio10TargetGenerator::Generate() } this->WriteString("</ImportGroup>\n", 1); this->WriteString("<ImportGroup Label=\"PropertySheets\">\n", 1); - this->WriteString("<Import Project=\"" VS10_USER_PROPS "\"" - " Condition=\"exists('" VS10_USER_PROPS "')\"" - " Label=\"LocalAppDataPlatform\" />\n", - 2); + { + std::string props = VS10_CXX_USER_PROPS; + if (const char* p = + this->GeneratorTarget->GetProperty("VS_USER_PROPS_CXX")) { + props = p; + this->ConvertToWindowsSlash(props); + } + this->WriteString("", 2); + (*this->BuildFileStream) + << "<Import Project=\"" << cmVS10EscapeXML(props) << "\"" + << " Condition=\"exists('" << cmVS10EscapeXML(props) << "')\"" + << " Label=\"LocalAppDataPlatform\" />\n"; + } this->WritePlatformExtensions(); this->WriteString("</ImportGroup>\n", 1); this->WriteString("<PropertyGroup Label=\"UserMacros\" />\n", 1); @@ -377,10 +387,8 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteSDKReferences(); - this->WriteString( - "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\"" - " />\n", - 1); + this->WriteString("<Import Project=\"" VS10_CXX_TARGETS "\" />\n", 1); + this->WriteTargetSpecificReferences(); this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1); this->WriteTargetsFileReferences(); |