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.
Change the minimum version to 3.0. Version 2.8.12 has never worked,
because it does not support the VERSION parameter in project().
Replace GREATER_EQUAL comparisons, these are only supported since 3.7.
Move PCH related code to a separate file, and include it after
options.cmake and init.cmake. Because only then the wxBUILD_PRECOMP
variable is fully initialized.
Closes#22312.
Compiling .mm files gives error 'Objective C file was disabled in PCH but is currently enabled'.
Enable the OBJCXX language so the Objective-C++ compiler will be detected and used for .mm files instead of the c++ compiler.
Detect if there are .mm files and enable PCH for them too.
Don't set COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS when cotire is not used.
Remove unused CMake code to get number of mono source files.
wxUSE_BASE=1 is also defined in wx_set_target_properties.
There seems no reason to define _LIB and DLL_EXPORTS, wx does not use it. They
were probably added because the vcxproj files have them.
Keep using cotire for CMake versions older than 3.16, or when user specifies wxBUILD_PRECOMP=COTIRE.
The scintilla headers need to be specified for target_precompile_headers to work.
Enable it when the target has at least 2 source files (same as cotire does).
In section "dependency" use "*" in processorArchitecture instead of specifying
the concrete architecture such as "amd64" or "x86". This allows to have just one
manifest for all architectures instead of having them for all supported architectures
individually differing in just processorArchitecture.
This was broken in b102afc316 (CMake: Don't include generator expression in
wxPLATFORM_LIB_DIR, 2021-10-17).
And for clarity, always add a '/' after directories.
Closes#19305
The documented name of the bundle version variable has BUNDLE twice, see
https://cmake.org/cmake/help/latest/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
and samples/Info.plist.in uses this variable, but we set
MACOSX_BUNDLE_VERSION instead, which seems wrong, so use the apparently
correct variable name instead.
Fix using PCH with MSVC too, which notably fixes using it with vcpkg.
Closes https://github.com/wxWidgets/wxWidgets/pull/2372
Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
Put each benchmark application in a sub-directory instead of specifying all in one
file, because cotire cannot create PCH targets for the same file twice (bench.cpp).
Add a build option (--disable-pic, wxBUILD_PIC=OFF) to disable it.
Note that it is always enabled for shared libraries and static third party libraries.
Rename all library targets to start with wx. This way it does not use generic
names like base or core that could interfere with other libraries that add
include the wxWidgets project.