[Git][wxwidgets/wxwidgets][master] 14 commits: CMake: Update cotire to 1.8.1

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Sep 17, 2025, 8:03:09 PM (13 days ago) Sep 17
to wx-commi...@googlegroups.com


Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets


Commits:
4d1b1d62 by Maarten Bent at 2025-09-14T21:51:07+02:00
CMake: Update cotire to 1.8.1

- - - - -
295d0894 by Maarten Bent at 2025-09-14T21:51:07+02:00
CMake: Remove duplicate find_package

Packages of third-party dependencies were searched twice. Once when adding them via wx_add_thirdparty_library to determine if they are available or of the built-in library should be used. And then again when including the third-party cmake file. Move all the logic into the third-party library cmake file.

This also removes the need to move the WebP variables into the parent scope.

- - - - -
76b9b232 by Maarten Bent at 2025-09-14T21:51:08+02:00
CMake: Don't recreate existing targets

This allows to use findPackage(wxWidgets) twice, e.g. to check for different components.

- - - - -
680b0b54 by Maarten Bent at 2025-09-14T21:51:08+02:00
CMake: Mark more variables as advanced

- - - - -
74cb6d92 by Maarten Bent at 2025-09-14T21:51:09+02:00
CMake: Add/update the version range

The CMake files are compatible with (at least) CMake 4.1.
This silences the 'CMake < 3.10 deprecated' messages with recent CMake versions.

- - - - -
8ca3d109 by Maarten Bent at 2025-09-14T21:51:10+02:00
Ignore tabs in cotire.cmake

- - - - -
f36633d2 by Maarten Bent at 2025-09-17T21:22:49+02:00
CMake: Use GNUInstallDirs variables when installing

These are used for the default library/archive/runtime/include directories,
but can be overridden with wxBUILD_INSTALL_<artifact>_DIR.

Replace the hard-coded lib and bin directories with wx_get_install_dir().

- - - - -
34993f9c by Maarten Bent at 2025-09-17T21:22:50+02:00
CMake: Move GEN_EXPR_DIR into function using it

- - - - -
87110a3c by Maarten Bent at 2025-09-17T21:25:17+02:00
CMake: Use global variable to keep track of installed files

- - - - -
2ddce18c by Maarten Bent at 2025-09-17T21:25:25+02:00
CMake: Improve WIN32_MSVC_NAMING when using other compilers

- - - - -
67da47fd by Maarten Bent at 2025-09-17T22:37:12+02:00
CMake: Create wxWidgets::wxWidgets target when building

This is used by FindwxWidgets and already created in the installed CMake files.
Also create it when building wxWidgets, so it can be used when wxWidgets is included via add_subdirectory.

Also create aliases to all targets using the wxWidgets prefix.

- - - - -
a278bec2 by Blake-Madden at 2025-09-18T01:25:35+02:00
Explain that clip paths don't work in NanoSVG, offer workaround

Closes #25805.

- - - - -
f3ab568a by Arrigo Marchiori at 2025-09-18T01:29:07+02:00
Force standard button foreground color when highlighted on MSW

When a button is being hovered, we paint its background colour according
to UxTheme, on Windows. Follow UxTheme for text colour as well.

Closes #25806.

- - - - -
ace3d4d9 by Vadim Zeitlin at 2025-09-18T01:29:27+02:00
Merge branch 'cmake-lib' of github.com:MaartenBent/wxWidgets

Miscellaneous CMake improvements.

See #25796.

- - - - -


30 changed files:

- .github/workflows/code_checks.yml
- CMakeLists.txt
- build/cmake/config.cmake
- build/cmake/functions.cmake
- build/cmake/init.cmake
- build/cmake/install.cmake
- build/cmake/lib/expat.cmake
- build/cmake/lib/jpeg.cmake
- build/cmake/lib/nanosvg.cmake
- build/cmake/lib/png.cmake
- build/cmake/lib/regex.cmake
- build/cmake/lib/tiff.cmake
- build/cmake/lib/webp.cmake
- build/cmake/lib/webview/CMakeLists.txt
- build/cmake/lib/webview_chromium/CMakeLists.txt
- build/cmake/lib/webview_chromium/cef_download.cmake.in
- build/cmake/lib/zlib.cmake
- build/cmake/locale/CMakeLists.txt
- build/cmake/main.cmake
- build/cmake/modules/FindSDL2.cmake
- build/cmake/modules/FindWebP.cmake
- build/cmake/modules/cotire.cmake
- build/cmake/modules/cotire_test/CMakeLists.txt
- build/cmake/options.cmake
- build/cmake/toolkit.cmake
- build/cmake/utils/CMakeLists.txt
- build/cmake/wxWidgetsConfig.cmake.in
- interface/wx/bmpbndl.h
- samples/minimal/CMakeLists.txt
- src/msw/anybutton.cpp


Changes:

=====================================
.github/workflows/code_checks.yml
=====================================
@@ -54,6 +54,7 @@ jobs:
':!build/bakefiles/make_dist.mk' \
':!build/bakefiles/scintilla.bkl' \
':!build/clone-minimal-vcxproj' \
+ ':!build/cmake/modules/cotire.cmake' \
':!build/upmake' \
':!build/vcxproj-clone' \
':!docs/doxygen/doxygen-awesome-css/*' \


=====================================
CMakeLists.txt
=====================================
@@ -7,7 +7,7 @@
# Licence: wxWindows licence
#############################################################################

-cmake_minimum_required(VERSION 3.5...3.31)
+cmake_minimum_required(VERSION 3.5...4.1)

if(NOT CMAKE_CONFIGURATION_TYPES)
get_property(HAVE_MULTI_CONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)


=====================================
build/cmake/config.cmake
=====================================
@@ -100,19 +100,21 @@ function(wx_write_config_inplace)
execute_process(
COMMAND
"${CMAKE_COMMAND}" -E ${COPY_CMD}
- "${wxBINARY_DIR}/lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}"
+ "${wxCONFIG_DIR}/inplace-${TOOLCHAIN_FULLNAME}"
"${wxBINARY_DIR}/wx-config"
)
endfunction()

function(wx_write_config)
- wx_get_install_dir(library "lib")
+ wx_get_install_dir(include)
+ wx_get_install_platform_dir(library)
+ wx_get_install_platform_dir(runtime)

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
- set(includedir "\${prefix}/include")
+ set(includedir "\${prefix}/${include_dir}")
set(libdir "\${exec_prefix}/${library_dir}")
- set(bindir "\${exec_prefix}/bin")
+ set(bindir "\${exec_prefix}/${runtime_dir}")

if(wxBUILD_MONOLITHIC)
set(MONOLITHIC 1)


=====================================
build/cmake/functions.cmake
=====================================
@@ -10,12 +10,22 @@
include(CMakeDependentOption)
include(ExternalProject)
include(CMakePrintHelpers)
+include(GNUInstallDirs)

# List of libraries added via wx_add_library() to use for wx-config
-# and headers added via wx_append_sources() to use for install.
set(wxLIB_TARGETS)
+# List of headers added via wx_append_sources() to use for install
set(wxINSTALL_HEADERS)
+# List of files not included in the install manifest
+set(WX_EXTRA_UNINSTALL_FILES)

+# create one target with all libraries, same as FindwxWidgets
+set(CREATE_WX_TARGET OFF)
+if(NOT TARGET wxWidgets AND NOT TARGET wxWidgets::wxWidgets)
+ set(CREATE_WX_TARGET ON)
+ add_library(wxWidgets INTERFACE)
+ add_library(wxWidgets::wxWidgets ALIAS wxWidgets)
+endif()

# This function adds a list of headers to a variable while prepending
# include/ to the path
@@ -91,10 +101,46 @@ macro(wx_get_flavour flavour prefix)
endif()
endmacro()

+# Get the library/runtime/archive directory
+macro(wx_get_install_dir artifact)
+ string(TOUPPER ${artifact} artifact_upper)
+
+ if("${artifact_upper}" STREQUAL "RUNTIME")
+ set(${artifact}_dir "${CMAKE_INSTALL_BINDIR}")
+ elseif("${artifact_upper}" STREQUAL "LIBRARY")
+ set(${artifact}_dir "${CMAKE_INSTALL_LIBDIR}")
+ elseif("${artifact_upper}" STREQUAL "ARCHIVE")
+ set(${artifact}_dir "${CMAKE_INSTALL_LIBDIR}")
+ elseif("${artifact_upper}" STREQUAL "INCLUDE")
+ set(${artifact}_dir "${CMAKE_INSTALL_INCLUDEDIR}")
+ else()
+ message(FATAL_ERROR "Unknown install artifact: ${artifact}")
+ endif()
+
+ if(wxBUILD_INSTALL_${artifact_upper}_DIR)
+ set(${artifact}_dir "${wxBUILD_INSTALL_${artifact_upper}_DIR}")
+ endif()
+endmacro()
+
+# Get the library/runtime/archive directory including platform specific sub-directory
+macro(wx_get_install_platform_dir artifact)
+ wx_get_install_dir(${artifact})
+ if(wxBUILD_INSTALL_PLATFORM_SUBDIR AND wxPLATFORM_LIB_DIR)
+ wx_string_append(${artifact}_dir "/${wxPLATFORM_LIB_DIR}")
+ endif()
+endmacro()
+
# Set properties common to builtin third party libraries and wx libs
function(wx_set_common_target_properties target_name)
cmake_parse_arguments(wxCOMMON_TARGET_PROPS "DEFAULT_WARNINGS" "" "" ${ARGN})

+ if(WIN32_MSVC_NAMING)
+ # Generator expression to not create different Debug and Release directories
+ set(GEN_EXPR_DIR "$<1:/>")
+ else()
+ set(GEN_EXPR_DIR "/")
+ endif()
+
set_target_properties(${target_name} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
@@ -248,7 +294,7 @@ function(wx_set_target_properties target_name)
endif()
# For compatibility with MSVS project files and makefile.vc, use arch
# suffix for non-x86 (including x86_64) DLLs.
- if(MSVC AND wxARCH_SUFFIX)
+ if(WIN32_MSVC_NAMING AND wxARCH_SUFFIX)
# This one already includes the leading underscore, so don't add another one.
wx_string_append(dll_suffix "${wxARCH_SUFFIX}")
endif()
@@ -262,7 +308,7 @@ function(wx_set_target_properties target_name)
endif()

set(lib_prefix "lib")
- if(MSVC OR (WIN32 AND wxBUILD_SHARED))
+ if(WIN32_MSVC_NAMING OR (WIN32 AND wxBUILD_SHARED))
set(lib_prefix)
elseif (CYGWIN AND wxBUILD_SHARED)
set(lib_prefix "cyg")
@@ -325,7 +371,7 @@ function(wx_set_target_properties target_name)
target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=1 wxUSE_BASE=0)
endif()

- if(WIN32 AND MSVC)
+ if(MSVC)
# Suppress deprecation warnings for standard library calls
target_compile_definitions(${target_name} PRIVATE
_CRT_SECURE_NO_DEPRECATE=1
@@ -340,13 +386,14 @@ function(wx_set_target_properties target_name)
endif()
target_compile_definitions(${target_name} PUBLIC _UNICODE)

+ wx_get_install_dir(library)
file(RELATIVE_PATH wxSETUP_HEADER_REL ${wxOUTPUT_DIR} ${wxSETUP_HEADER_PATH})
target_include_directories(${target_name}
BEFORE
PUBLIC
$<BUILD_INTERFACE:${wxSETUP_HEADER_PATH}>
$<BUILD_INTERFACE:${wxSOURCE_DIR}/include>
- $<INSTALL_INTERFACE:lib/${wxSETUP_HEADER_REL}>
+ $<INSTALL_INTERFACE:${library_dir}/${wxSETUP_HEADER_REL}>
$<INSTALL_INTERFACE:${wxINSTALL_INCLUDE_DIR}>
)

@@ -425,22 +472,6 @@ function(wx_set_target_properties target_name)
wx_set_common_target_properties(${target_name})
endfunction()

-macro(wx_get_install_dir artifact default)
- wx_get_build_install_dir(${artifact} ${default})
- if(wxBUILD_INSTALL_PLATFORM_SUBDIR AND wxPLATFORM_LIB_DIR)
- wx_string_append(${artifact}_dir "/${wxPLATFORM_LIB_DIR}")
- endif()
-endmacro()
-
-macro(wx_get_build_install_dir artifact default)
- string(TOUPPER ${artifact} artifact_upper)
- if(wxBUILD_INSTALL_${artifact_upper}_DIR)
- set(${artifact}_dir "${wxBUILD_INSTALL_${artifact_upper}_DIR}")
- else()
- set(${artifact}_dir ${default})
- endif()
-endmacro()
-

# Add a wxWidgets library
# wx_add_library(<target_name> [IS_BASE;IS_PLUGIN;IS_MONO] <src_files>...)
@@ -478,20 +509,25 @@ macro(wx_add_library name)

add_library(${name} ${wxBUILD_LIB_TYPE} ${src_files})
add_library(wx::${name_short} ALIAS ${name})
+ add_library(wxWidgets::${name_short} ALIAS ${name})
+ if(CREATE_WX_TARGET)
+ target_link_libraries(wxWidgets INTERFACE ${name})
+ endif()
+
wx_set_target_properties(${name} ${ARGN})
set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})

- # Setup install
- if(WIN32_MSVC_NAMING)
- set(runtime_default_dir "lib")
- else()
- # configure puts the .dll in the bin directory
- set(runtime_default_dir "bin")
- endif()
+ wx_get_install_platform_dir(library)
+ wx_get_install_platform_dir(archive)
+ wx_get_install_platform_dir(runtime)

- wx_get_install_dir(library "lib")
- wx_get_install_dir(archive "lib")
- wx_get_install_dir(runtime "${runtime_default_dir}")
+ if(WIN32_MSVC_NAMING AND NOT wxBUILD_INSTALL_RUNTIME_DIR)
+ # override the default 'bin' to match MSVC solution
+ set(runtime_dir "lib")
+ if(wxBUILD_INSTALL_PLATFORM_SUBDIR AND wxPLATFORM_LIB_DIR)
+ wx_string_append(runtime_dir "/${wxPLATFORM_LIB_DIR}")
+ endif()
+ endif()

wx_install(TARGETS ${name}
EXPORT wxWidgetsTargets
@@ -619,7 +655,7 @@ macro(wx_set_builtin_target_ouput_name target target_name)
endif()

set(lib_prefix "lib")
- if(MSVC OR (WIN32 AND wxBUILD_SHARED))
+ if(WIN32_MSVC_NAMING OR (WIN32 AND wxBUILD_SHARED))
set(lib_prefix)
elseif (CYGWIN AND wxBUILD_SHARED)
set(lib_prefix "cyg")
@@ -663,7 +699,8 @@ function(wx_set_builtin_target_properties target_name)

wx_set_common_target_properties(${target_name} DEFAULT_WARNINGS)
if(NOT wxBUILD_SHARED)
- wx_install(TARGETS ${name} EXPORT wxWidgetsTargets ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}")
+ wx_get_install_platform_dir(archive)
+ wx_install(TARGETS ${name} EXPORT wxWidgetsTargets ARCHIVE DESTINATION "${archive_dir}")
endif()
endfunction()

@@ -685,6 +722,11 @@ function(wx_add_builtin_library name)

add_library(${name} STATIC ${src_list})
add_library(wx::${name_short} ALIAS ${name})
+ add_library(wxWidgets::${name_short} ALIAS ${name})
+ if(CREATE_WX_TARGET)
+ target_link_libraries(wxWidgets INTERFACE ${name})
+ endif()
+
wx_set_builtin_target_properties(${name})
set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})
endfunction()
@@ -718,14 +760,6 @@ function(wx_add_thirdparty_library var_name lib_name help_str)
wx_option(${var_name} ${help_str} ${thirdparty_lib_default}
STRINGS builtin sys OFF)

- if(${var_name} STREQUAL "sys")
- # If the sys library can not be found use builtin
- find_package(${lib_name})
- if(NOT ${lib_name}_FOUND)
- wx_option_force_value(${var_name} builtin)
- endif()
- endif()
-
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} ${var_name} "${help_str}" PARENT_SCOPE)
endfunction()



=====================================
build/cmake/init.cmake
=====================================
@@ -198,22 +198,18 @@ if(WIN32)
endif()
endif()

+wx_get_install_dir(include)
if(WIN32_MSVC_NAMING)
if(wxBUILD_SHARED)
set(lib_suffix "_dll")
else()
set(lib_suffix "_lib")
endif()
-
set(wxPLATFORM_LIB_DIR "${wxCOMPILER_PREFIX}${wxARCH_SUFFIX}${lib_suffix}")
-
- # Generator expression to not create different Debug and Release directories
- set(GEN_EXPR_DIR "$<1:/>")
- set(wxINSTALL_INCLUDE_DIR "include")
+ set(wxINSTALL_INCLUDE_DIR "${include_dir}")
else()
- set(GEN_EXPR_DIR "/")
wx_get_flavour(lib_flavour "-")
- set(wxINSTALL_INCLUDE_DIR "include/wx-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${lib_flavour}")
+ set(wxINSTALL_INCLUDE_DIR "${include_dir}/wx-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${lib_flavour}")
endif()

if(wxBUILD_CUSTOM_SETUP_HEADER_PATH)
@@ -674,6 +670,7 @@ if(wxUSE_GUI)
find_package(SDL2)
if(NOT SDL2_FOUND)
find_package(SDL)
+ mark_as_advanced(SDL_INCLUDE_DIR SDLMAIN_LIBRARY)
endif()
if(NOT SDL2_FOUND AND NOT SDL_FOUND)
message(WARNING "SDL not found, SDL Audio back-end won't be available")


=====================================
build/cmake/install.cmake
=====================================
@@ -36,7 +36,7 @@ if(MSVC)
)
endif()

-wx_get_install_dir(library "lib")
+wx_get_install_platform_dir(library)

# setup header and wx-config
if(WIN32_MSVC_NAMING)
@@ -63,16 +63,18 @@ else()
WORLD_EXECUTE WORLD_READ
)

- install(DIRECTORY DESTINATION "bin")
+ wx_get_install_platform_dir(runtime)
+ install(DIRECTORY DESTINATION "${runtime_dir}")
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
\"${CMAKE_INSTALL_PREFIX}/${library_dir}/wx/config/${wxBUILD_FILE_ID}\" \
- \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wx-config\" \
+ \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${runtime_dir}/wx-config\" \
)"
)
+ list(APPEND WX_EXTRA_UNINSTALL_FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${runtime_dir}/wx-config")
endif()

-wx_get_build_install_dir(library "lib")
+wx_get_install_dir(library)
set(wx_cmake_dir "${library_dir}/cmake/wxWidgets-${wxMAJOR_VERSION}.${wxMINOR_VERSION}")

install(EXPORT wxWidgetsTargets NAMESPACE wx:: DESTINATION "${wx_cmake_dir}/${wxPLATFORM_LIB_DIR}")
@@ -113,21 +115,6 @@ else()
endif()

if(NOT TARGET ${UNINST_NAME})
- # these symlinks are not included in the install manifest
- set(WX_EXTRA_UNINSTALL_FILES)
- if(NOT WIN32_MSVC_NAMING)
- if(IPHONE)
- set(EXE_SUFFIX ".app")
- else()
- set(EXE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
- endif()
-
- set(WX_EXTRA_UNINSTALL_FILES
- "${CMAKE_INSTALL_PREFIX}/bin/wx-config"
- "${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX}"
- )
- endif()
-
configure_file(
"${wxSOURCE_DIR}/build/cmake/uninstall.cmake.in"
"${wxBINARY_DIR}/uninstall.cmake"


=====================================
build/cmake/lib/expat.cmake
=====================================
@@ -7,6 +7,14 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_EXPAT STREQUAL "sys")
+ find_package(EXPAT)
+ if(NOT EXPAT_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_EXPAT builtin)
+ endif()
+endif()
+
if(wxUSE_EXPAT STREQUAL "builtin")
# TODO: implement building expat via its CMake file, using
# add_subdirectory or ExternalProject_Add
@@ -17,6 +25,4 @@ if(wxUSE_EXPAT STREQUAL "builtin")
)
set(EXPAT_LIBRARIES wxexpat)
set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib)
-elseif(wxUSE_EXPAT)
- find_package(EXPAT REQUIRED)
endif()


=====================================
build/cmake/lib/jpeg.cmake
=====================================
@@ -7,6 +7,14 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_LIBJPEG STREQUAL "sys")
+ find_package(JPEG)
+ if(NOT JPEG_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_LIBJPEG builtin)
+ endif()
+endif()
+
if(wxUSE_LIBJPEG STREQUAL "builtin")
wx_add_builtin_library(wxjpeg
src/jpeg/jaricom.c
@@ -62,6 +70,4 @@ if(wxUSE_LIBJPEG STREQUAL "builtin")
)
set(JPEG_LIBRARIES wxjpeg)
set(JPEG_INCLUDE_DIR ${wxSOURCE_DIR}/src/jpeg)
-elseif(wxUSE_LIBJPEG)
- find_package(JPEG REQUIRED)
endif()


=====================================
build/cmake/lib/nanosvg.cmake
=====================================
@@ -7,6 +7,14 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_NANOSVG STREQUAL "sys")
+ find_package(NanoSVG)
+ if(NOT NanoSVG_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_NANOSVG builtin)
+ endif()
+endif()
+
if(wxUSE_NANOSVG STREQUAL "builtin")
set(wxUSE_NANOSVG_EXTERNAL 0 PARENT_SCOPE)
elseif(wxUSE_NANOSVG)
@@ -16,8 +24,6 @@ elseif(wxUSE_NANOSVG)
set(NANOSVG_INCLUDE_DIRS )
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL TRUE)

- find_package(NanoSVG REQUIRED)
-
foreach(TARGETNAME NanoSVG::nanosvg NanoSVG::nanosvgrast unofficial::nanosvg)
if(NOT TARGET ${TARGETNAME})
continue()


=====================================
build/cmake/lib/png.cmake
=====================================
@@ -7,6 +7,14 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_LIBPNG STREQUAL "sys")
+ find_package(PNG)
+ if(NOT PNG_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_LIBPNG builtin)
+ endif()
+endif()
+
if(wxUSE_LIBPNG STREQUAL "builtin")
# TODO: implement building libpng via its CMake file, using
# add_subdirectory or ExternalProject_Add
@@ -53,6 +61,4 @@ if(wxUSE_LIBPNG STREQUAL "builtin")
target_link_libraries(wxpng PRIVATE ${ZLIB_LIBRARIES})
set(PNG_LIBRARIES wxpng)
set(PNG_INCLUDE_DIRS ${wxSOURCE_DIR}/src/png)
-elseif(wxUSE_LIBPNG)
- find_package(PNG REQUIRED)
endif()


=====================================
build/cmake/lib/regex.cmake
=====================================
@@ -7,6 +7,17 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_REGEX STREQUAL "sys")
+ find_package(PCRE2)
+ if(NOT PCRE2_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_REGEX builtin)
+ else()
+ set(REGEX_LIBRARIES ${PCRE2_LIBRARIES})
+ set(REGEX_INCLUDE_DIRS ${PCRE2_INCLUDE_DIRS})
+ endif()
+endif()
+
if(wxUSE_REGEX STREQUAL "builtin")
# TODO: implement building PCRE2 via its CMake file, using
# add_subdirectory or ExternalProject_Add
@@ -45,8 +56,4 @@ if(wxUSE_REGEX STREQUAL "builtin")
set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/3rdparty/pcre/src/wx)
target_compile_definitions(wxregex PRIVATE __WX__ HAVE_CONFIG_H)
target_include_directories(wxregex PRIVATE ${wxSETUP_HEADER_PATH} ${wxSOURCE_DIR}/include ${REGEX_INCLUDE_DIRS})
-elseif(wxUSE_REGEX)
- find_package(PCRE2 REQUIRED)
- set(REGEX_LIBRARIES ${PCRE2_LIBRARIES})
- set(REGEX_INCLUDE_DIRS ${PCRE2_INCLUDE_DIRS})
endif()


=====================================
build/cmake/lib/tiff.cmake
=====================================
@@ -7,6 +7,15 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_LIBTIFF STREQUAL "sys")
+ find_package(TIFF)
+ mark_as_advanced(Tiff_DIR)
+ if(NOT TIFF_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_LIBTIFF builtin)
+ endif()
+endif()
+
if(wxUSE_LIBTIFF STREQUAL "builtin")
# TODO: implement building libtiff via its CMake file, using
# add_subdirectory or ExternalProject_Add
@@ -76,6 +85,4 @@ if(wxUSE_LIBTIFF STREQUAL "builtin")
target_link_libraries(wxtiff PRIVATE ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES})
set(TIFF_LIBRARIES wxtiff)
set(TIFF_INCLUDE_DIRS ${wxSOURCE_DIR}/src/tiff/libtiff)
-elseif(wxUSE_LIBTIFF)
- find_package(TIFF REQUIRED)
endif()


=====================================
build/cmake/lib/webp.cmake
=====================================
@@ -7,6 +7,15 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_LIBWEBP STREQUAL "sys")
+ find_package(WebP)
+ mark_as_advanced(WebP_DIR)
+ if(NOT WebP_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_LIBWEBP builtin)
+ endif()
+endif()
+
if(wxUSE_LIBWEBP STREQUAL "builtin")
set(WEBP_ROOT "${wxSOURCE_DIR}/3rdparty/libwebp")
set(WEBP_BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}/webp-build")
@@ -63,10 +72,10 @@ if(wxUSE_LIBWEBP STREQUAL "builtin")

set(WebP_LIBRARIES webp webpdemux sharpyuv)
if(NOT wxBUILD_SHARED)
+ wx_get_install_platform_dir(archive)
wx_install(TARGETS ${WebP_LIBRARIES}
EXPORT wxWidgetsTargets
- ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
+ ARCHIVE DESTINATION "${archive_dir}"
)
endif()
-
endif()


=====================================
build/cmake/lib/webview/CMakeLists.txt
=====================================
@@ -153,7 +153,7 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
${WEBKIT2_LIBRARIES}
)

- wx_get_install_dir(library "lib")
+ wx_get_install_platform_dir(library)

wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION "${library_dir}/wx/${WX_WEB_EXT_VERSION}/web-extensions")



=====================================
build/cmake/lib/webview_chromium/CMakeLists.txt
=====================================
@@ -313,9 +313,10 @@ else()
)
endif()

+wx_get_install_platform_dir(archive)
wx_install(TARGETS libcef_dll_wrapper
EXPORT wxWidgetsTargets
- ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
+ ARCHIVE DESTINATION "${archive_dir}"
)

wx_lib_include_directories(wxwebview PRIVATE ${CEF_ROOT})


=====================================
build/cmake/lib/webview_chromium/cef_download.cmake.in
=====================================
@@ -7,7 +7,7 @@
# Licence: wxWindows licence
#############################################################################

-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.5...4.1)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()


=====================================
build/cmake/lib/zlib.cmake
=====================================
@@ -7,6 +7,14 @@
# Licence: wxWindows licence
#############################################################################

+if(wxUSE_ZLIB STREQUAL "sys")
+ find_package(ZLIB)
+ if(NOT ZLIB_FOUND)
+ # If the sys library can not be found use builtin
+ wx_option_force_value(wxUSE_ZLIB builtin)
+ endif()
+endif()
+
if(wxUSE_ZLIB STREQUAL "builtin")
# TODO: implement building zlib via its CMake file, using
# add_subdirectory or ExternalProject_Add
@@ -40,6 +48,4 @@ if(wxUSE_ZLIB STREQUAL "builtin")
endif()
set(ZLIB_LIBRARIES wxzlib)
set(ZLIB_INCLUDE_DIRS ${wxSOURCE_DIR}/src/zlib)
-elseif(wxUSE_ZLIB)
- find_package(ZLIB REQUIRED)
endif()


=====================================
build/cmake/locale/CMakeLists.txt
=====================================
@@ -12,13 +12,12 @@ if(wxBUILD_LOCALES)
endif()
endif()

+mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE)
+
if(NOT wxBUILD_LOCALES)
return()
endif()

-mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE)
-mark_as_advanced(GETTEXT_MSGFMT_EXECUTABLE)
-
# list and process the po files
file(GLOB _po_files "${wxSOURCE_DIR}/locale/*.po")
foreach(_po_file ${_po_files})


=====================================
build/cmake/main.cmake
=====================================
@@ -47,9 +47,7 @@ endif()

if(WIN32_MSVC_NAMING)
include(build/cmake/build_cfg.cmake)
-endif()
-
-if(NOT MSVC)
+else()
# Write wx-config
include(build/cmake/config.cmake)
endif()


=====================================
build/cmake/modules/FindSDL2.cmake
=====================================
@@ -172,4 +172,4 @@ INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)

-MARK_AS_ADVANCED(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)
+MARK_AS_ADVANCED(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR SDL2_LIBRARY_TEMP)


=====================================
build/cmake/modules/FindWebP.cmake
=====================================
@@ -6,6 +6,3 @@ if(NOT WebP_FOUND)
pkg_check_modules(WebP libwebp libwebpdemux)
endif()
endif()
-
-set(WebP_LIBRARIES ${WebP_LIBRARIES} PARENT_SCOPE)
-set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIRS} PARENT_SCOPE)


=====================================
build/cmake/modules/cotire.cmake
=====================================
@@ -37,13 +37,13 @@ set(__COTIRE_INCLUDED TRUE)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(PUSH)
endif()
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.5...4.1)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(POP)
endif()

set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")

# activate select policies
if (POLICY CMP0025)
@@ -1067,10 +1067,10 @@ macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
set (${_headerIsIgnoredVar} TRUE)
elseif (IS_DIRECTORY "${_headerFile}")
set (${_headerIsIgnoredVar} TRUE)
- elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
- # heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
+ elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
+ # heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
- # with the error message "error: no include path in which to search for header.h"
+ # with the error message "error: no include path in which to search for header"
set (${_headerIsIgnoredVar} TRUE)
else()
set (${_headerIsIgnoredVar} FALSE)
@@ -1694,6 +1694,9 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
endif()
endif()
else()
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+ file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
# Clang-cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
@@ -1706,10 +1709,10 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}"
- "/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
+ "/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
else()
# return as a flag string
- set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+ set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
@@ -1844,26 +1847,28 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
set (_flags "-include \"${_prefixFile}\"")
endif()
else()
+ file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
# Clang-cl.exe options used
# /Yu uses a precompiled header file during build
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
if (_pchFile)
+ file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
if (_flags)
# append to list
- list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
+ list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
else()
# return as a flag string
- set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+ set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
- list (APPEND _flags "/FI${_prefixFile}")
+ list (APPEND _flags "/FI${_prefixFileNative}")
else()
# return as a flag string
- set (_flags "/FI\"${_prefixFile}\"")
+ set (_flags "/FI\"${_prefixFileNative}\"")
endif()
endif()
endif()
@@ -2045,8 +2050,10 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
else()
set (_ccacheExe "${_launcher}")
endif()
+ # ccache 3.7.0 replaced --print-config with --show-config
+ # use -p instead, which seems to work for all version for now, sigh
execute_process(
- COMMAND "${_ccacheExe}" "--print-config"
+ COMMAND "${_ccacheExe}" "-p"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RESULT_VARIABLE _result
OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -2395,6 +2402,9 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ if (COTIRE_DEBUG)
+ message (STATUS "set_property: SOURCE ${_hostFile} APPEND_STRING COMPILE_FLAGS ${_flags}")
+ endif()
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
# make object file generated from host file depend on prefix header
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
@@ -2447,6 +2457,9 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ if (COTIRE_DEBUG)
+ message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+ endif()
# make object files generated from source files depend on precompiled header
set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
endif()
@@ -2460,6 +2473,9 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ if (COTIRE_DEBUG)
+ message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+ endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
endif()
@@ -2477,6 +2493,9 @@ function (cotire_setup_prefix_file_inclusion _language _target _prefixFile)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
+ if (COTIRE_DEBUG)
+ message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
+ endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
# make object files generated from source files depend on prefix header
@@ -2594,6 +2613,9 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _options)
set_property(TARGET ${_target} APPEND PROPERTY ${_options})
+ if (COTIRE_DEBUG)
+ message (STATUS "set_property: TARGET ${_target} APPEND PROPERTY ${_options}")
+ endif()
endif()
endif()
endif()


=====================================
build/cmake/modules/cotire_test/CMakeLists.txt
=====================================
@@ -1,6 +1,6 @@
# cotire example project

-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.5...4.1)

if (POLICY CMP0058)
# Ninja requires custom command byproducts to be explicit


=====================================
build/cmake/options.cmake
=====================================
@@ -88,9 +88,9 @@ set(wxBUILD_INSTALL_LIBRARY_DIR "" CACHE STRING "override default sub-directory
mark_as_advanced(wxBUILD_INSTALL_LIBRARY_DIR)
set(wxBUILD_INSTALL_ARCHIVE_DIR "" CACHE STRING "override default sub-directory to install archive files")
mark_as_advanced(wxBUILD_INSTALL_ARCHIVE_DIR)
-wx_option(wxBUILD_INSTALL_PLATFORM_SUBDIR "platform specific sub-directory (MSVC-naming)" ON)
+wx_option(wxBUILD_INSTALL_PLATFORM_SUBDIR "use platform specific sub-directory (MSVC-naming)" ON)
mark_as_advanced(wxBUILD_INSTALL_PLATFORM_SUBDIR)
-wx_option(wxBUILD_INSTALL_PDB "install pdb files in the runtime direcotry (MSVC)" OFF)
+wx_option(wxBUILD_INSTALL_PDB "install pdb files in the runtime directory (MSVC-naming)" OFF)
mark_as_advanced(wxBUILD_INSTALL_PDB)

# Use the MSVC/makefile naming convention, or the configure naming convention,


=====================================
build/cmake/toolkit.cmake
=====================================
@@ -123,6 +123,7 @@ if(UNIX AND NOT WIN32 AND (WXX11 OR WXGTK2 OR (WXGTK AND wxHAVE_GDK_X11)))
find_package(X11 REQUIRED)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${X11_INCLUDE_DIR})
list(APPEND wxTOOLKIT_LIBRARIES ${X11_LIBRARIES})
+ mark_as_advanced(X11_xcb_xkb_INCLUDE_PATH)
endif()

if(WXQT)


=====================================
build/cmake/utils/CMakeLists.txt
=====================================
@@ -25,9 +25,10 @@ if(wxUSE_XRC)

set_target_properties(wxrc PROPERTIES FOLDER "Utilities")

+ wx_get_install_dir(runtime)
wx_install(TARGETS wxrc
- RUNTIME DESTINATION "bin"
- BUNDLE DESTINATION "bin"
+ RUNTIME DESTINATION "${runtime_dir}"
+ BUNDLE DESTINATION "${runtime_dir}"
)

if(NOT WIN32_MSVC_NAMING AND wxBUILD_INSTALL)
@@ -40,10 +41,12 @@ if(wxUSE_XRC)
# Don't use wx_install() here to preserve escaping.
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
- \"${CMAKE_INSTALL_PREFIX}/bin/${wxrc_output_name}${EXE_SUFFIX}\" \
- \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX}\" \
+ \"${CMAKE_INSTALL_PREFIX}/${runtime_dir}/${wxrc_output_name}${EXE_SUFFIX}\" \
+ \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${runtime_dir}/wxrc${EXE_SUFFIX}\" \
)"
)
+ list(APPEND WX_EXTRA_UNINSTALL_FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${runtime_dir}/wxrc${EXE_SUFFIX}")
+ set(WX_EXTRA_UNINSTALL_FILES ${WX_EXTRA_UNINSTALL_FILES} PARENT_SCOPE)
endif()
endif()



=====================================
build/cmake/wxWidgetsConfig.cmake.in
=====================================
@@ -70,6 +70,23 @@ macro(wx_inherit_property source dest name)
endforeach()
endmacro()

+macro(wx_copy_target ns name libname)
+ get_target_property(target_type wx::${libname} TYPE)
+ if(target_type STREQUAL STATIC_LIBRARY)
+ add_library(${ns}::${name} STATIC IMPORTED)
+ else()
+ add_library(${ns}::${name} SHARED IMPORTED)
+ endif()
+ wx_inherit_property(wx::${libname} ${ns}::${name} IMPORTED_CONFIGURATIONS)
+ wx_inherit_property(wx::${libname} ${ns}::${name} INTERFACE_COMPILE_DEFINITIONS)
+ wx_inherit_property(wx::${libname} ${ns}::${name} INTERFACE_INCLUDE_DIRECTORIES)
+ wx_inherit_property(wx::${libname} ${ns}::${name} INTERFACE_LINK_LIBRARIES)
+ wx_inherit_property(wx::${libname} ${ns}::${name} IMPORTED_LINK_INTERFACE_LANGUAGES)
+ wx_inherit_property(wx::${libname} ${ns}::${name} IMPORTED_LOCATION)
+ wx_inherit_property(wx::${libname} ${ns}::${name} IMPORTED_IMPLIB)
+ wx_inherit_property(wx::${libname} ${ns}::${name} IMPORTED_LINK_DEPENDENT_LIBRARIES)
+endmacro()
+
# for compatibility with FindwxWidgets
set(wxWidgets_LIBRARIES)

@@ -109,24 +126,15 @@ foreach(libname @wxLIB_TARGETS@)
endif()

# add an alias from wx::<lib> to wx::wx<lib>
- if(CMAKE_VERSION VERSION_LESS "3.18")
- # CMake <3.18 does not support alias to non-global imported target, create a copy of the library
- get_target_property(target_type wx::${libname} TYPE)
- if(target_type STREQUAL STATIC_LIBRARY)
- add_library(wx::${name} STATIC IMPORTED)
+ if(NOT TARGET wx::${name})
+ if(CMAKE_VERSION VERSION_LESS "3.18")
+ # CMake <3.18 does not support alias to non-global imported target, create a copy of the library
+ wx_copy_target(wx ${name} ${libname})
+ wx_copy_target(wxWidgets ${name} ${libname})
else()
- add_library(wx::${name} SHARED IMPORTED)
+ add_library(wx::${name} ALIAS wx::${libname})
+ add_library(wxWidgets::${name} ALIAS wx::${libname})
endif()
- wx_inherit_property(wx::${libname} wx::${name} IMPORTED_CONFIGURATIONS)
- wx_inherit_property(wx::${libname} wx::${name} INTERFACE_COMPILE_DEFINITIONS)
- wx_inherit_property(wx::${libname} wx::${name} INTERFACE_INCLUDE_DIRECTORIES)
- wx_inherit_property(wx::${libname} wx::${name} INTERFACE_LINK_LIBRARIES)
- wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LINK_INTERFACE_LANGUAGES)
- wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LOCATION)
- wx_inherit_property(wx::${libname} wx::${name} IMPORTED_IMPLIB)
- wx_inherit_property(wx::${libname} wx::${name} IMPORTED_LINK_DEPENDENT_LIBRARIES)
- else()
- add_library(wx::${name} ALIAS wx::${libname})
endif()

# add to FindwxWidgets variable


=====================================
interface/wx/bmpbndl.h
=====================================
@@ -248,13 +248,14 @@ public:

Please note that the current implementation uses NanoSVG library
(https://github.com/memononen/nanosvg) for parsing and rasterizing SVG
- images which imposes the following limitations:
+ images, which does not support the following:

- - Text elements are not supported at all (see note for workaround).
- - SVG 1.1 filters are not supported.
- - Embedded images are not supported (see note for workaround).
+ - Text elements
+ - SVG 1.1 filters
+ - Embedded images
+ - Clip paths

- These limitations will be relaxed in the future wxWidgets versions.
+ See note below for possible workarounds.

Please also note that this method is only available in the ports
providing raw bitmap access via wxPixelData. This is the case for all
@@ -278,12 +279,16 @@ public:
@note Converting text objects to path objects will allow them to be
rasterized as expected. This can be done in an SVG editor such as
Inkscape. (In Inkscape, select a text object and choose
- "Object to Path" from the "Path" menu.)\n
+ "Object to Path" from the "Path" menu.)\n\n
Converting embedded images to paths from an SVG editor will
allow them to be rasterized. For example, selecting "Trace Bitmap"
from the "Path" menu in Inkscape can perform this. This is only
recommended for simple images, however, as more complex images
- may not rasterize well.
+ may not rasterize well.\n\n
+ To work around lack of support for clip paths, you can manually cut and remove portions
+ of objects (rather than using a clip path to hide them).
+ In Inkscape, this can be done via either "Path" → "Difference"
+ or "Path" → "Division" (i.e., cookie-cutter subtraction).
*/
static wxBitmapBundle FromSVG(char* data, const wxSize& sizeDef);



=====================================
samples/minimal/CMakeLists.txt
=====================================
@@ -14,7 +14,7 @@
#

# Declare the minimum required CMake version
-cmake_minimum_required(VERSION 3.5...3.31)
+cmake_minimum_required(VERSION 3.5...4.1)

if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# If no deployment target has been set default to the minimum supported


=====================================
src/msw/anybutton.cpp
=====================================
@@ -1555,9 +1555,24 @@ bool wxAnyButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
// finally draw the label
if ( ShowsLabel() )
{
- COLORREF colFg = state & ODS_DISABLED
- ? ::GetSysColor(COLOR_GRAYTEXT)
- : wxColourToRGB(GetForegroundColour());
+ COLORREF colFg;
+ if ( state & ODS_DISABLED )
+ {
+ colFg = ::GetSysColor(COLOR_GRAYTEXT);
+ }
+#if wxUSE_UXTHEME
+ else if ( wxUxThemeIsActive() &&
+ GetButtonState(this, state) == wxAnyButton::State_Current )
+ {
+ // The button is highlighted, use the standard colour to ensure
+ // that its text is readable.
+ colFg = ::GetSysColor(COLOR_BTNTEXT);
+ }
+#endif // wxUSE_UXTHEME
+ else
+ {
+ colFg = wxColourToRGB(GetForegroundColour());
+ }

wxTextColoursChanger changeFg(hdc, colFg, CLR_INVALID);
wxBkModeChanger changeBkMode(hdc, wxBRUSHSTYLE_TRANSPARENT);



View it on GitLab: https://gitlab.com/wxwidgets/wxwidgets/-/compare/9e1ac33d876c58a9fb60b1bd474d2699828755d7...ace3d4d936115f4b34a0d8c240a29f5cd7c23743

--
View it on GitLab: https://gitlab.com/wxwidgets/wxwidgets/-/compare/9e1ac33d876c58a9fb60b1bd474d2699828755d7...ace3d4d936115f4b34a0d8c240a29f5cd7c23743
You're receiving this email because of your account on gitlab.com.


Reply all
Reply to author
Forward
0 new messages