Discussion:
Using custom wx_vc12_local.props with MSVS 2013
PB
2014-10-04 17:57:14 UTC
Permalink
Hi

I have just installed Visual Studio Express 2013 for Windows Desktop
(Version 12.0.30723.00 Update 3) and I want to build wxWidgets (SVN trunk,
32-bit configurations only) with it but also keep using libraries produced
by VS 2008, therefore I have to keep both versions of compiled libraries
separate. When building wxWidgets with a provided MSVC makefile, this is
achieved by defining a custom compiler prefix, e.g.:
nmake -f makefile.vc BUILD=debug COMPILER_PREFIX=vc12.

When building wxWidgets with VC11/12 IDE, it is recommended to use a custom
.props file. From WXWIN/docs/msw/install.txt:

Special note for VC11 and VC12 projects: it is possible to customize the
build
by creating wx_vcN_local.props (N=11 or 12) file in build\msw directory
which
is used, if it exists, by the projects. The settings in this file override
the
default values for the properties such as wxCfg (corresponding to the CFG
makefile variable described below) or wxVendor (corresponding to VENDOR).
For
example, you could set wxCompilerPrefix to "vc120" in your local properties
file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<wxCompilerPrefix>vc120</wxCompilerPrefix>
</PropertyGroup>
</Project>

to use "vc120" prefix for the build directories used by VC12 and so to allow
its build files to coexist with the files produced by the other MSVC
versions.
Notice that by using a separate local props file you ensure that your
changes
won't be lost when updating to a future wxWidgets version.



I have created WXWIN/build/msw/wx_vc12_local.props file with the contents
pasted from above. But when I open WXWIN/build/msw/wx_vc12.sln in MSVS
2013, it appears as the file were not loaded. The libraries are still built
into vc_lib directory and when I check the property manager I don't see
wx_vc12_local in the list of loaded property sheets? I have looked into
wx_base.vcxproj and I didn't find any reference to wx_vc12_local.props (or
a name mask combined with a MSVS version), only to wx_local.props. If I
create wx_local.props file with the same content as wx_vc12_local.props it
gets loaded by the IDE, but the new compiler prefix is still not used and
using a hardcoded name for the .props file would make a VS-version-specific
customization impossible anyway.
Use the same project files for all MSBuild-based MSVS versions.
Get rid of version-specific MSVS project files, we can reuse the same projects
for all MSBuild-based versions, i.e. 2010, 2011 and 2013.
and the now removed, MSVS-version-specific project files (e.g.
wx_vc12_base.vcxproj) did indeed include wx_vc12_local.props file if it
existed.

Is the information provided in install.txt still valid and I am doing
something wrong (quite likely) or is there now a different way to customize
the setup with the IDE?

Thank you,
P.B.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
'Ray Satiro' via wx-users
2014-10-04 18:36:38 UTC
Permalink
Post by PB
I have created WXWIN/build/msw/wx_vc12_local.props file with the
contents pasted from above. But when I open
WXWIN/build/msw/wx_vc12.sln in MSVS 2013, it appears as the file were
not loaded. The libraries are still built into vc_lib directory and
when I check the property manager I don't see wx_vc12_local in the
list of loaded property sheets? I have looked into wx_base.vcxproj and
I didn't find any reference to wx_vc12_local.props (or a name mask
combined with a MSVS version), only to wx_local.props. If I create
wx_local.props file with the same content as wx_vc12_local.props it
gets loaded by the IDE, but the new compiler prefix is still not used
and using a hardcoded name for the .props file would make a
VS-version-specific customization impossible anyway.
Use the same project files for all MSBuild-based MSVS versions.
Get rid of version-specific MSVS project files, we can reuse the same projects
for all MSBuild-based versions, i.e. 2010, 2011 and 2013.
and the now removed, MSVS-version-specific project files (e.g.
wx_vc12_base.vcxproj) did indeed include wx_vc12_local.props file if
it existed.
I edit the setup props directly rather than use another file. Otherwise
you'd have to use wx_local.props. I do it that way so that if something
comes along and changes the setup props and there's a conflict it is
brought to my attention. If you copy the setup to local and then edit
the local, which from what I remember is what is recommended, then if
the setup changes in a future release your local still has the old
variables. So if all you want to do is change the compiler prefix think
about this:

diff --git a/build/msw/wx_setup.props b/build/msw/wx_setup.props
index 2710133..2965ab8 100644
--- a/build/msw/wx_setup.props
+++ b/build/msw/wx_setup.props
@@ -3,7 +3,7 @@
<PropertyGroup Label="UserMacros">
<wxShortVersionString>31</wxShortVersionString>
<wxToolkitPrefix>msw</wxToolkitPrefix>
- <wxCompilerPrefix>vc</wxCompilerPrefix>
+ <wxCompilerPrefix>vc$(PlatformToolsetVersion)</wxCompilerPrefix>
<wxCfg>
</wxCfg>
<wxVendor>custom</wxVendor>
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
'Ray Satiro' via wx-users
2014-10-04 20:58:04 UTC
Permalink
Post by PB
Is the information provided in install.txt still valid and I am doing
something wrong (quite likely) or is there now a different way to
customize the setup with the IDE?
I have submitted a patch to correct the special instructions in
install.txt. Also you may want to review my suggestions for handling
setup.h, as described in the patch. http://trac.wxwidgets.org/ticket/16597
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
PB
2014-10-05 08:54:33 UTC
Permalink
Hi

Thanks for the info (and submitting the ticket). I guess the elegant way
described in install.txt, i.e. somwehat like HTML CSS, was too good to be
true and is not possible with MSBuild property sheets.

Regards,
P.B.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...