From e48d740ed7be39c470bd9d30d6d68e0a1f8902c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 19 May 2020 00:43:37 +0200 Subject: [PATCH 1/2] Make props file work for builds using any prefix/DLL combinations The existing wxwidgets.props wasn't particularly useful as it couldn't be used with with wx DLLs when the user project configuration were not called "DLL Debug" or "DLL Release" (and it makes little sense for the user application to use "DLL" in its configuration names just because it happens to use wx as DLL, of course). It also couldn't be used with the libraries built using nmake with a custom COMPILER_PREFIX, which, significantly, includes the official MSW binaries. Try to fix both problems by checking for the actually existing libraries and using whichever ones we find. This is somewhat surprising for a project file to do, but it seems like it should result in the most useful behaviour in practice as it allows user projects importing this file to work out of the box in all of the following situations: - Using official wxMSW binaries. - Building wxMSW from source without any customization. - Building wxMSW from source using reasonable custom compiler prefix. --- wxwidgets.props | 111 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 6 deletions(-) diff --git a/wxwidgets.props b/wxwidgets.props index 074d6b8a30..61bc05cfbd 100644 --- a/wxwidgets.props +++ b/wxwidgets.props @@ -3,28 +3,127 @@ This is a property sheet to be included in MSVS projects of the applications using wxWidgets. Use "View|Property Manager" and choose "Add Existing Property Sheet..." from the context menu to add it from the IDE or edit your - .vcxproj file directly and add + .vcxproj file directly and add tag to it. --> - + - + + + + 100 + 110 + 120 + 140 + 141 + 142 + + 100 + 110 + 120 + 14x + 14x + 14x + + + + + + + 1 + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxToolsetVerABICompat)$(wxArchSuffix)_dll$(wxCfg) + + + + + + 1 + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxToolsetVerABICompat)$(wxArchSuffix)_lib$(wxCfg) + + + + + + 1 + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxToolsetVersion)$(wxArchSuffix)_dll$(wxCfg) + + + + + + 1 + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxToolsetVersion)$(wxArchSuffix)_lib$(wxCfg) + + + + + + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxArchSuffix)_dll$(wxCfg) + + + + + + 1 + $(MSBuildThisFileDirectory)lib\vc$(wxArchSuffix)_lib$(wxCfg) + + + + + + wxMSVC_VERSION_AUTO;wxMSVC_VERSION_ABI_COMPAT + + + + wxMSVC_VERSION_AUTO + + + WXUSINGDLL + + + + + - __WXMSW__;$(wxUsingDllDefine);%(PreprocessorDefinitions) + __WXMSW__;$(wxUsingDllDefine);$(wxVersionDefine);%(PreprocessorDefinitions) $(MSBuildThisFileDirectory)include\msvc;$(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories) __WXMSW__;$(wxUsingDllDefine);%(PreprocessorDefinitions) - $(MSBuildThisFileDirectory)lib\$(wxOutDirName)\$(wxToolkitPrefix)$(wxSuffix);$(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories) + $(wxLibOrDllDir)\$(wxToolkitPrefix)$(wxSuffix);$(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories) - $(MSBuildThisFileDirectory)lib\$(wxOutDirName);%(AdditionalLibraryDirectories) + $(wxLibOrDllDir);%(AdditionalLibraryDirectories) From 56be52b84164dc97bee339fe5fb41b255bd54aa1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 May 2020 00:58:29 +0200 Subject: [PATCH 2/2] Explain in more details how to use wxWidgets.props Also describe a manual change which needs to be done at the project level when creating a new empty project in MSVS. --- docs/msw/install.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/msw/install.md b/docs/msw/install.md index 1ec18d7943..2c5f592889 100644 --- a/docs/msw/install.md +++ b/docs/msw/install.md @@ -529,8 +529,15 @@ Building Applications Using wxWidgets {#msw_build_apps} ===================================== If you use MSVS 2010 or later IDE for building your project, simply add -`wxwidgets.props` property sheet to (all) your project(s) using wxWidgets. -You don't need to do anything else. +`wxwidgets.props` property sheet to (all) your project(s) using wxWidgets +by using "View|Property Manager" menu item to open the property manager +window and then selecting "Add Existing Property Sheet..." from the context +menu in this window. + +If you've created a new empty project (i.e. chose "Empty Project" in the +"Create a new project" window shown by MSVS rather than "Windows Desktop"), +you need to change "Linker|System|SubSystem" in the project properties to +"Windows", from the default "Console". You don't need to do anything else. If you want to use CMake for building your project, please see @ref overview_cmake.