Skip to content

Commit

Permalink
[command-new] Improved msbuild template (#11101)
Browse files Browse the repository at this point in the history
* Improved msbuild template

* change order of ImportGroup of conantoolchain.props

Co-authored-by: memsharded <james@conan.io>
  • Loading branch information
franramirez688 and memsharded authored Apr 26, 2022
1 parent 114e60c commit 39b0c0b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions conans/assets/templates/new_v2_msbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,29 @@
<RootNamespace>{{name}}</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ImportGroup Label="PropertySheets">
<Import Project="conan\\conantoolchain.props" />
{{dependencies}}
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>{{type}}</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>{{type}}</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>{{type}}</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>{{type}}</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand All @@ -92,9 +92,6 @@
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
{{dependencies}}
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Expand Down Expand Up @@ -401,7 +398,7 @@ def get_msbuild_lib_files(name, version, package_name="Pkg"):
conanfile = Template(conanfile_sources_v2, keep_trailing_newline=True).render(d)
test_d = {"name": "test_" + name, "version": version, "pkg_name": package_name,
"type": "Application",
"dependencies": '<Import Project="conan/conandeps.props" />'}
"dependencies": '<Import Project="conan\\conandeps.props" />'}
test_sln = Template(sln_file, keep_trailing_newline=True).render(test_d)
test_vcp = Template(vcxproj, keep_trailing_newline=True).render(test_d)
test_conanfile = Template(test_conanfile_v2, keep_trailing_newline=True).render(test_d)
Expand Down

0 comments on commit 39b0c0b

Please sign in to comment.