diff options
-rw-r--r-- | .gitlab/ci/configure_debian10_aarch64_ninja.cmake | 1 | ||||
-rw-r--r-- | .gitlab/ci/configure_debian10_ninja.cmake | 1 | ||||
-rw-r--r-- | .gitlab/ci/configure_fedora37_makefiles.cmake | 1 | ||||
-rw-r--r-- | .gitlab/ci/docker/debian10-aarch64/deps_packages.lst | 1 | ||||
-rw-r--r-- | .gitlab/ci/docker/debian10/deps_packages.lst | 1 | ||||
-rw-r--r-- | .gitlab/ci/docker/fedora37/deps_packages.lst | 1 | ||||
-rw-r--r-- | .gitlab/os-linux.yml | 6 | ||||
-rw-r--r-- | Help/release/dev/FindwxWidgets-imported-target.rst | 4 | ||||
-rw-r--r-- | Modules/FindwxWidgets.cmake | 21 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/FindwxWidgets/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindwxWidgets/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindwxWidgets/Test/main.cpp | 7 |
13 files changed, 69 insertions, 3 deletions
diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake index 7407959..16282b6 100644 --- a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake +++ b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake @@ -65,6 +65,7 @@ set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") set(CMake_TEST_FindTIFF "ON" CACHE BOOL "") +set(CMake_TEST_FindwxWidgets "ON" CACHE BOOL "") set(CMake_TEST_FindX11 "ON" CACHE BOOL "") set(CMake_TEST_FindXalanC "ON" CACHE BOOL "") set(CMake_TEST_FindXercesC "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_debian10_ninja.cmake b/.gitlab/ci/configure_debian10_ninja.cmake index e8d6d55..327c1c5 100644 --- a/.gitlab/ci/configure_debian10_ninja.cmake +++ b/.gitlab/ci/configure_debian10_ninja.cmake @@ -71,6 +71,7 @@ set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") set(CMake_TEST_FindTIFF "ON" CACHE BOOL "") +set(CMake_TEST_FindwxWidgets "ON" CACHE BOOL "") set(CMake_TEST_FindX11 "ON" CACHE BOOL "") set(CMake_TEST_FindXalanC "ON" CACHE BOOL "") set(CMake_TEST_FindXercesC "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_fedora37_makefiles.cmake b/.gitlab/ci/configure_fedora37_makefiles.cmake index 725cc46..f5676aa 100644 --- a/.gitlab/ci/configure_fedora37_makefiles.cmake +++ b/.gitlab/ci/configure_fedora37_makefiles.cmake @@ -69,6 +69,7 @@ set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") set(CMake_TEST_FindTIFF "ON" CACHE BOOL "") +set(CMake_TEST_FindwxWidgets "ON" CACHE BOOL "") set(CMake_TEST_FindX11 "ON" CACHE BOOL "") set(CMake_TEST_FindXalanC "ON" CACHE BOOL "") set(CMake_TEST_FindXercesC "ON" CACHE BOOL "") diff --git a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst b/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst index 5e30e16..36b5d8c 100644 --- a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst +++ b/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst @@ -76,6 +76,7 @@ libsdl-dev libsqlite3-dev libtiff-dev libuv1-dev +libwxgtk3.0-dev libx11-dev libxalan-c-dev libxerces-c-dev diff --git a/.gitlab/ci/docker/debian10/deps_packages.lst b/.gitlab/ci/docker/debian10/deps_packages.lst index 3df41f5..bd4377a 100644 --- a/.gitlab/ci/docker/debian10/deps_packages.lst +++ b/.gitlab/ci/docker/debian10/deps_packages.lst @@ -79,6 +79,7 @@ libsdl-dev libsqlite3-dev libtiff-dev libuv1-dev +libwxgtk3.0-dev libx11-dev libxalan-c-dev libxerces-c-dev diff --git a/.gitlab/ci/docker/fedora37/deps_packages.lst b/.gitlab/ci/docker/fedora37/deps_packages.lst index 9ce8007..61382b5 100644 --- a/.gitlab/ci/docker/fedora37/deps_packages.lst +++ b/.gitlab/ci/docker/fedora37/deps_packages.lst @@ -105,6 +105,7 @@ SDL-devel sqlite-devel swig unixODBC-devel +wxGTK-devel xalan-c-devel xerces-c-devel xz-devel diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 9a53401..60cd0b7 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -45,7 +45,7 @@ ### Debian .debian10: - image: "kitware/cmake:ci-debian10-x86_64-2023-02-07" + image: "kitware/cmake:ci-debian10-x86_64-2023-03-08" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -60,7 +60,7 @@ CMAKE_CI_NO_INSTALL: 1 .debian10_aarch64: - image: "kitware/cmake:ci-debian10-aarch64-2023-02-07" + image: "kitware/cmake:ci-debian10-aarch64-2023-03-08" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -69,7 +69,7 @@ ### Fedora .fedora37: - image: "kitware/cmake:ci-fedora37-x86_64-2023-02-07" + image: "kitware/cmake:ci-fedora37-x86_64-2023-03-08" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes" diff --git a/Help/release/dev/FindwxWidgets-imported-target.rst b/Help/release/dev/FindwxWidgets-imported-target.rst new file mode 100644 index 0000000..c04e0ac --- /dev/null +++ b/Help/release/dev/FindwxWidgets-imported-target.rst @@ -0,0 +1,4 @@ +FindwxWidgets-imported-target +----------------------------- + +* The :module:`FindwxWidgets` module now provides an imported target. diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 3159ff7..cc76b35 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -113,6 +113,16 @@ If wxWidgets is required (i.e., not an optional part): include(${wxWidgets_USE_FILE}) # and for each of your dependent executable/library targets: target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) + +Imported targets +^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.27 + +This module defines the following :prop_tgt:`IMPORTED` targets: + +``wxWidgets::wxWidgets`` + An interface library providing usage requirements for the found components. #]=======================================================================] # @@ -981,6 +991,17 @@ find_package_handle_standard_args(wxWidgets ) unset(wxWidgets_HANDLE_COMPONENTS) +if(wxWidgets_FOUND AND NOT TARGET wxWidgets::wxWidgets) + add_library(wxWidgets::wxWidgets INTERFACE IMPORTED) + target_link_libraries(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES}) + target_link_directories(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARY_DIRS}) + target_include_directories(wxWidgets::wxWidgets INTERFACE ${wxWidgets_INCLUDE_DIRS}) + target_compile_options(wxWidgets::wxWidgets INTERFACE ${wxWidgets_CXX_FLAGS}) + target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS}) + # FIXME: Add "$<$<CONFIG:Debug>:${wxWidgets_DEFINITIONS_DEBUG}>" + # if the debug library variant is available. +endif() + #===================================================================== # Macros for use in wxWidgets apps. # - This module will not fail to find wxWidgets based on the code diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d913e93..446e400 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1484,6 +1484,7 @@ if(BUILD_TESTING) SQLite3 TIFF Vulkan + wxWidgets X11 XalanC XercesC diff --git a/Tests/FindwxWidgets/CMakeLists.txt b/Tests/FindwxWidgets/CMakeLists.txt new file mode 100644 index 0000000..b66f838 --- /dev/null +++ b/Tests/FindwxWidgets/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindwxWidgets.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindwxWidgets/Test" + "${CMake_BINARY_DIR}/Tests/FindwxWidgets/Test" + ${build_generator_args} + --build-project TestFindwxWidgets + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindwxWidgets/Test/CMakeLists.txt b/Tests/FindwxWidgets/Test/CMakeLists.txt new file mode 100644 index 0000000..ecc9c36 --- /dev/null +++ b/Tests/FindwxWidgets/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.26) +project(TestFindwxWidgets CXX) +include(CTest) + +find_package(wxWidgets REQUIRED) + +add_executable(test_tgt main.cpp) +target_link_libraries(test_tgt wxWidgets::wxWidgets) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.cpp) +target_link_libraries(test_var PRIVATE ${wxWidgets_LIBRARIES}) +target_link_directories(test_var PRIVATE ${wxWidgets_LIBRARY_DIRS}) +target_include_directories(test_var PRIVATE ${wxWidgets_INCLUDE_DIRS}) +target_compile_options(test_var PRIVATE ${wxWidgets_CONFIG_OPTIONS}) +target_compile_definitions(test_var PRIVATE ${wxWidgets_DEFINITIONS}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindwxWidgets/Test/main.cpp b/Tests/FindwxWidgets/Test/main.cpp new file mode 100644 index 0000000..0e576cf --- /dev/null +++ b/Tests/FindwxWidgets/Test/main.cpp @@ -0,0 +1,7 @@ +#include <wx/filefn.h> + +int main() +{ + wxGetCwd(); + return 0; +} |