Closed smanders closed 6 years ago
wxcmakeover items
target_include_directories()
and target_compile_definitions()
instead of cmake hackery like the following:
get_directory_property(global_includes INCLUDE_DIRECTORIES)
set_property(TARGET ${lib_name} PROPERTY
INCLUDE_DIRECTORIES ${global_includes}
${wxroot}/src/foo
${wxroot}/src/bar
)
set_property(TARGET ${lib_name} PROPERTY
COMPILE_DEFINITIONS foobar=0
)
include_directories()
calls in favor of target_include_directories()
target_link_libraries()
to build up library dependency graph, which will also improve the cmake-generated targets.cmake files
xpGetCompilerPrefix()
if it's available (otherwise default to toolset
being vc
if MSVC and cc
otherwise) -- this will enable us to only make changes to externpro to support future versions of MSVC instead of also needing to modify the wxcmake projectNAMESPACE wx::
to install(EXPORT
call so wx targets are in a namespace -- for example media
(which once conflicted with another media project) will be wx::media
I believe this issue is complete with the commits referenced above - if not, other commits will also reference this issue...
there's some good wxcmakeover-type work for the wxx project, too...
completed with commits referenced above
errors compiling targets on Windows that depend on wxWidgets, similar to the following:
cannot convert argument from 'const char *' to 'LPCWSTR'
cannot convert argument from 'LPSTR' to 'LPCWSTR'
which makes me immediately think "UNICODE"
and sure enough, in attempting to inherit compile definitions, I'd done the following in base.cmake:
target_compile_definitions(${lib_name} PUBLIC WXBUILDING __WXMSW__ UNICODE _UNICODE
which impacted the wxwidgets31-targets.cmake file:
set_target_properties(wx::base PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "WXBUILDING;__WXMSW__;UNICODE;_UNICODE"
which meant that projects like Sdbase also errantly had these compile definitions
what I want is for these definitions to be inherited from wxWidgets libraries/targets that depend on wxbase, but only for the build of wxWidgets -- not for projects that use wxWidgets
there is a wxcmake project and repo that we extract into the
build/cmake
subdirectory of wxWidgets to build wx via cmake on Windowsthere have been many improvements to cmake since wxcmake was first developed (or things I just didn't know about) -- along with other changes that could be made to simplify the maintenance of wxcmake -- hence "wxcmakeover"