summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-21 12:51:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-21 12:51:21 (GMT)
commitb5a5b227f9a3d88e1c493427e3983aee28c284eb (patch)
treefd04d6205242308ce49d99c9eb1d32c891fea770 /Modules
parentbcf066435ca30a685002bcfbc6677eaaa74a6190 (diff)
parente8b77084dfaaa211913acaec871e8f9fc0cedd88 (diff)
downloadCMake-b5a5b227f9a3d88e1c493427e3983aee28c284eb.zip
CMake-b5a5b227f9a3d88e1c493427e3983aee28c284eb.tar.gz
CMake-b5a5b227f9a3d88e1c493427e3983aee28c284eb.tar.bz2
Merge topic 'FindwxWidgets-verify-wx-config'
e8b77084 FindwxWidgets: Verify existence of libraries reported by wx-config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !704
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindwxWidgets.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index bc906e5..af4daf0 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -893,6 +893,28 @@ else()
endif()
endif()
+# Check that all libraries are present, as wx-config does not check it
+set(_wx_lib_missing "")
+foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
+ if("${_wx_lib_}" MATCHES "^-l(.*)")
+ set(_wx_lib_name "${CMAKE_MATCH_1}")
+ unset(_wx_lib_found CACHE)
+ find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS ${wxWidgets_LIBRARY_DIRS})
+ if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
+ list(APPEND _wx_lib_missing ${_wx_lib_name})
+ endif()
+ unset(_wx_lib_found CACHE)
+ endif()
+endforeach()
+
+if (_wx_lib_missing)
+ string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
+ DBG_MSG_V("wxWidgets not found due to following missing libraries: ${_wx_lib_missing}")
+ set(wxWidgets_FOUND FALSE)
+ unset(wxWidgets_LIBRARIES)
+endif()
+unset(_wx_lib_missing)
+
# Check if a specfic version was requested by find_package().
if(wxWidgets_FOUND)
find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)