Merge branch 'wx_cmake_dir' of github.com:cjmayo/wxWidgets

CMake: Install cmake files into a versioned directory.

See #25757.
This commit is contained in:
Vadim Zeitlin
2025-09-08 14:28:21 +02:00
3 changed files with 20 additions and 9 deletions
+7 -6
View File
@@ -427,18 +427,19 @@ function(wx_set_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()
if(wxBUILD_INSTALL_PLATFORM_SUBDIR)
if(${artifact}_dir)
wx_string_append(${artifact}_dir ${GEN_EXPR_DIR})
endif()
wx_string_append(${artifact}_dir "${wxPLATFORM_LIB_DIR}")
endif()
endmacro()
+6 -3
View File
@@ -70,7 +70,10 @@ else()
)
endif()
install(EXPORT wxWidgetsTargets NAMESPACE wx:: DESTINATION "lib/cmake/wxWidgets/${wxPLATFORM_LIB_DIR}")
wx_get_build_install_dir(library "lib")
set(wx_cmake_dir "${library_dir}/cmake/wxWidgets-${wxMAJOR_VERSION}.${wxMINOR_VERSION}")
install(EXPORT wxWidgetsTargets NAMESPACE wx:: DESTINATION "${wx_cmake_dir}/${wxPLATFORM_LIB_DIR}")
# find_package config file
include(CMakePackageConfigHelpers)
@@ -93,11 +96,11 @@ write_basic_package_version_file(
configure_package_config_file(
"${wxSOURCE_DIR}/build/cmake/wxWidgetsConfig.cmake.in"
"${projectConfig}"
INSTALL_DESTINATION "lib/cmake/wxWidgets"
INSTALL_DESTINATION "${wx_cmake_dir}"
)
install(
FILES "${projectConfig}" "${versionConfig}"
DESTINATION "lib/cmake/wxWidgets"
DESTINATION "${wx_cmake_dir}"
)
# uninstall target
+7
View File
@@ -206,6 +206,13 @@ Changes in behaviour which may result in build errors
the official ones and those using MSVS projects, but also when using
makefile.vc or CMake, for consistency.
- CMake files are now installed in a versioned subdirectory, e.g.
lib/cmake/wxWidgets-3.3, to allow installing multiple versions of wxWidgets
simultaneously, and not just "wxWidgets" as before. Please update your
CMake files if you rely on the exact name of this directory. Note that
nothing needs to be done if you simply use find_package(wxWidgets) as it
still works in the same way as before.
- Support for memory debugging that was previously disabled but could be
activated by using wxUSE_MEMORY_TRACING, wxUSE_GLOBAL_MEMORY_OPERATORS etc
options was completely removed. Please use address sanitizer or similar