Commit Graph

2 Commits

Author SHA1 Message Date
Maarten Bent
978271ee81 CMake: Support target files of multiple builds
For example vc_lib, vc_x64_lib, vc_dll, vc_x64_dll, gcc_lib and gcc_dll all in
the same installation location. Disable the architecture (32 vs 64 bit)
compatibility check in the version file.
2022-06-18 17:06:16 +02:00
Maarten Bent
f6631a3d6a CMake: Create a config file for use with find_package
The config file uses the wxWidgetsTargets file to find all the libraries that
can be linked to.

It supports checking for components (e.g. base, core, aui, gl) and fails if a
requested component is not found.

Set the version compatibility to SameMinorVersion (when CMake supports this),
because different minor wxWidgets versions (3.0 and 3.1/3.2) are expected to
break API.

Because the default libraries are named like wx::wxname, create an alias that
is just called wx::name. CMake older than 3.18 does not support creating an
alias to non-global imported targets, so manually create a library with the
same properties.

The wxWidgets CMake build only builds the Release and Debug configurations, but
when creating a (MSVC) CMake project it also contains MinSizeRel and
RelWithDebInfo configurations. By default these seems to use the Debug
libraries, causing build errors. Map them to the Release libraries instead.

Also create a wxWidgets_LIBRARIES variable that can be used to link with, so
users can keep using the same variables from FindwxWidgets.
2022-06-18 17:06:15 +02:00