Open davemc50 opened 5 years ago
Plugin Install task depends on wxWidgets_LIBRARIES
cmake/PluginInstall.cmake: TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} ${wxWidgets_LIBRARIES} ${EXTRA_LIBS} )
With debug enabled
-- /usr/share/cmake-3.10/Modules/FindwxWidgets.cmake(170): wxWidgets not found due to following missing libraries: wx_baseu_core-3.0 wx_baseu_html-3.0 wx_baseu_adv-3.0
Does rtlsdr_pi really need all those wxWidgets libraries?
cmake/PluginConfigure.cmake: SET(wxWidgets_USE_LIBS base core net xml html adv)
don't know if it matters, but I believe wxwidgets_use_libs has been depreciated
apt-get install libwxgtk-media3.0-dev gettext
Thanks, I guess we need to add those libs first chance we get.
Some solutions for Archlinux?
For the current version of Opencpn 5.0 you will need version wxWidgets 3.1.2, but I know absolutely nothing about Archlinux.
Some solutions for Archlinux?
Update: i found the solution in the Dockerfile for Archlinux of MoneyManagerEx 1.4.0 branch:
# fix broken wxgtk3
sudo ln -sf /usr/bin/wx-config{-gtk3,} || true
Old post but since I was dropped here by a search engine, I give my two cents worth, working on another OpenCPN plug-in where I had the very same problem in one my test machines which I updated from Lubuntu 16.04LTS to 18.04LTS: The issue was with the alternatives versions of wxWidgets (2.8 and 3.0). The default selection made the cmake to fail. Probably I am using also the same PluginConfigure.cmake
, which is copy-pasted on about one hundred or so plug-in for now:
PluginConfigure.cmake:IF(NOT DEFINED wxWidgets_USE_FILE)
PluginConfigure.cmake: SET(wxWidgets_USE_LIBS base core net xml html adv aui webview)
Solution to the "alternatives" annoyance:
~$ sudo update-alternatives --display wx-config
wx-config - auto mode
link best version is /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0
link currently points to /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0
link wx-config is /usr/bin/wx-config
/usr/lib/x86_64-linux-gnu/wx/config/base-unicode-3.0 - priority 306
/usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0 - priority 308
/usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0 - priority 307
Gtk2 is selected:
~$ sudo wx-config --selected-config
gtk2-unicode-3.0
Let's change that:
~$ sudo update-alternatives --config wx-config
There are 3 choices for the alternative wx-config (providing /usr/bin/wx-config).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0 308 auto mode
1 /usr/lib/x86_64-linux-gnu/wx/config/base-unicode-3.0 306 manual mode
2 /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0 308 manual mode
3 /usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0 307 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/x86_64-linux-gnu/wx/config/gtk3-unicode-3.0 to provide
/usr/bin/wx-config (wx-config) in manual mode
Now OK Gtk3:
~$ sudo wx-config --selected-config
gtk3-unicode-3.0
Try to build again:
build$ cmake -DCMAKE_BUILD_TYPE=Release ..
Works now:
-- Found wxWidgets: -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_baseu-3.0;-lwx_gtk3u_core-3.0;
-lwx_baseu_net-3.0;-lwx_baseu_xml-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_adv-3.0;
-lwx_gtk3u_aui-3.0;-lwx_gtk3u_webview-3.0;-lwx_gtk3u_gl-3.0 (found version "3.0.4")
Thanks Petri I always learn something from you.
As mentioned above, on *ubuntu 18.04 LTS (cmake 3.10) one needs to replace wxWidgets_USE_LIBS. But with what? You can get the selection 2 (see above), gtk2-unicode-3.0 to work, by modifying in PluginConfigure.cmake
- SET(wxWidgets_USE_LIBS base core net xml html adv)
+ SET(wxWidgets_FIND_COMPONENTS base core net xml html adv)
- FIND_PACKAGE(wxWidgets REQUIRED)
+ FIND_PACKAGE(wxWidgets COMPONENTS ${wxWidgets_FIND_COMPONENTS}
Petri, this is something we'll might need to do in all plugin frontend setups, isn't it?
See this concurrent issue https://github.com/OpenCPN/OpenCPN/issues/1898
Rick, probably you do not want to enforce it everywhere. "If it ain' t broke, don' t fix it." Ubuntu 18.04LTS is the only platform on which I have had this issue. And there is 20.04LTS already, what will be the problem there, who knows? On Debian 10 there is an issue with wxWebView... it never ends!
I noticed this on a Travis build for 18.04 LTS - it goes unnoticed - binary without a test is not a binary! Fix like this is not a big deal once you know where the problem is.
Seeing the Travis issue, maybe, in your CI template for plug-ins, you could start looking for a scripted solution to prepare various platforms, something like in this script from OpenCPN v5.1 beta: https://git.io/JfcNi . The investment to embed this wisdom in build processes for stable platforms like the LTSs would not be useless but, of course it will be a big investment, human resource wise.
Out of curiosity, I installed Ubuntu 20.04LTS and OpenCPN v5.0 and also v5.1beta. There is no ambiguity with "alternative" GTK-version anymore: there is only one, the sharp-looking GTK3 available! From the build point of view it is simpler for the plug-in than 18.04LTS (which I am personally going to drop now, too much hassle).
Nevertheless, to find wxWidgets, one needs to use method explained above.
In addition, in order to not to have ambiguity (there is always one!) with OpenGL version with CMake v3.17, one can add - if your plug-in needs those functions:
IF (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0")
# `FindOpenGL`` prefers GLVND by default when available:
CMAKE_POLICY(SET CMP0072 NEW)
ENDIF(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0")
FIND_PACKAGE(OpenGL)
For memory, in Ubuntu 18.04LTS CMake version is 3.10. The above policy was introduced in 3.12.
apt-get install libwxgtk-media3.0-dev gettext
FYI on Ubuntu 22.04 I had to use:
apt install libwxgtk-media3.0-gtk3-dev gettext
Kubuntu 18.04.3 LTS
Which version or package of wxWidgets is it missing?
Here's what is currently installed...