summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-09 12:37:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-09 12:37:49 (GMT)
commitb1595174148ee49bb2c4ae9cbd8ca5700abc31b0 (patch)
tree6a0f6ed2852a49bc1d0749529b50b3e00c3776b8 /Modules
parentbf3071a890a9ccdb7df676fc822034a70336ca58 (diff)
parente36e455b7cdb50beb7c9cd16db8e27ecc1eaca70 (diff)
downloadCMake-b1595174148ee49bb2c4ae9cbd8ca5700abc31b0.zip
CMake-b1595174148ee49bb2c4ae9cbd8ca5700abc31b0.tar.gz
CMake-b1595174148ee49bb2c4ae9cbd8ca5700abc31b0.tar.bz2
Merge topic 'FindwxWidgets-imported-target'
e36e455b7c FindwxWidgets: Add an imported target 42c84b1e2e ci: Add wxWidgets to Debian and Fedora base images Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8289
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindwxWidgets.cmake21
1 files changed, 21 insertions, 0 deletions
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