I’ve had this working before but…
I’m building a cross platform project that uses wxWidgets. Currently I’m cross-compiling windows 64bit from Fedora linux. The project performs a bootstrap build of wxWidgets if required. This part is working fine and the main wxWindows libraries are being found.
The CMake FindwxWindows module seems to treat the regex and scintilla libraries as “support” libraries and not main libraries?
Initially I got a very unhelpful error that wxWindows was not found without further context, I had to turn on all the debug messages to find the problem:
wxWidgets not found due to following missing libraries:
wxregexu-3.1-x86_64-w64-mingw32 wxscintilla-3.1-x86_64-w64-mingw32
This should probably be changed to a real message instead of debug.
The libraries exist:
$ ls -1 external/dist/lib/
libportaudio.a
libportaudio.la
libwx_baseu-3.1-x86_64-w64-mingw32.a
libwx_baseu_net-3.1-x86_64-w64-mingw32.a
libwx_baseu_xml-3.1-x86_64-w64-mingw32.a
libwx_mswu_adv-3.1-x86_64-w64-mingw32.a
libwx_mswu_aui-3.1-x86_64-w64-mingw32.a
libwx_mswu_core-3.1-x86_64-w64-mingw32.a
libwx_mswu_gl-3.1-x86_64-w64-mingw32.a
libwx_mswu_html-3.1-x86_64-w64-mingw32.a
libwx_mswu_media-3.1-x86_64-w64-mingw32.a
libwx_mswu_propgrid-3.1-x86_64-w64-mingw32.a
libwx_mswu_qa-3.1-x86_64-w64-mingw32.a
libwx_mswu_ribbon-3.1-x86_64-w64-mingw32.a
libwx_mswu_richtext-3.1-x86_64-w64-mingw32.a
libwx_mswu_stc-3.1-x86_64-w64-mingw32.a
libwx_mswu_webview-3.1-x86_64-w64-mingw32.a
libwx_mswu_xrc-3.1-x86_64-w64-mingw32.a
libwxregexu-3.1-x86_64-w64-mingw32.a
libwxscintilla-3.1-x86_64-w64-mingw32.a
I found where the libraries are being “found” and added some of my own debug:
-- Looking for wxregexu-3.1-x86_64-w64-mingw32
-- Looking for wxscintilla-3.1-x86_64-w64-mingw32
-- Looking for expat
-- Looking for png
-- Looking for jpeg
-- Looking for tiff
-- Looking for z
-- Looking for rpcrt4
-- Looking for oleaut32
-- Looking for ole32
-- Looking for uuid
-- Looking for lzma
-- Looking for uxtheme
-- Looking for winspool
-- Looking for winmm
-- Looking for shell32
-- Looking for shlwapi
-- Looking for comctl32
-- Looking for comdlg32
-- Looking for advapi32
-- Looking for version
-- Looking for wsock32
-- Looking for gdi32
-- Looking for oleacc
So does all the -3.1… stuff need to be stripped off for it to find it? The relevant part of the module reads:
# 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)
message(STATUS "Looking for ${_wx_lib_name}")
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()
Any pointers?
Thanks,
Richard