Commit Graph

14 Commits

Author SHA1 Message Date
Vadim Zeitlin
664d1617be Fix problems with CMake install target
Handle DESDIR and spaces in the installation path correctly.

Closes #22610.

(cherry picked from commit 43d0eb48c15ab87ecb8d20a145f9f374f4ff745e)
2022-07-24 18:31:00 +02:00
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
Maarten Bent
9ffe6f5575 CMake: Use correct INSTALL_INTERFACE include directory on Linux
The headers are installed in 'include/wx-3.1/', so also use this in the INSTALL_INTERFACE.
Determine wxINSTALL_INCLUDE_DIR only once and reuse it in install.cmake.
2022-06-18 16:08:35 +02:00
Maarten Bent
9d7577677e CMake: Consistent [wx_]install usage
Use wx_install macro so install is only used when wxBUILD_INSTALL is set.
The install.cmake script has a check for wxBUILD_INSTALL, so don't use it there.
2022-06-18 16:08:35 +02:00
Maarten Bent
039f0a924a CMake: Create only one target file
Put the target file in lib/cmake/wxWidgets directory.
2022-04-12 22:08:46 +02:00
Maarten Bent
b102afc316 CMake: Don't include generator expression in wxPLATFORM_LIB_DIR
So wxPLATFORM_LIB_DIR can be used in locations where generator expressions are not supported.
2021-10-17 11:52:30 +02:00
Maarten Bent
979a4b5237 CMake: Improve wxrc name
Include the version and flavour in the target name, no need to rename anymore.
Add the wxrc symlink to extra uninstall files, not the actual target name.
2021-06-06 23:38:38 +02:00
Maarten Bent
3e0057757b CMake: Use a macro to get the flavour
Also include the flavour in builtin target names and include path.
2021-06-06 23:38:38 +02:00
Maarten Bent
f830bde25b CMake: Improve library names
Use the same output names as MSVC and makefile.gcc/vc on Windows, and the same as configure on other platforms.
2021-06-06 23:36:59 +02:00
Maarten Bent
4196c67b72 CMake: Create wx-config for MinGW builds
Use the same output folder for setup.h and wx-config as configure does.
2020-02-16 16:35:24 +01:00
Maarten Bent
8cf2b683be CMake: Fix installation include directory 2018-12-06 22:39:41 +01:00
Maarten Bent
c0544afcd7 CMake: Improve installation on Linux
Install setup header, wx-config and wxrc. Make wx-config executable.
Add renamed files and symbolic links to uninstall target.
2018-12-02 17:45:43 +01:00
Tobias Taschner
da2b8ea812
Add CMake build system
Add CMake build system for libraries, tests and samples
update_files.py converts build/files into CMake format.
build/update-setup-h has been modified to update build/cmake/setup.h.in.
2017-01-03 20:53:10 +01:00