openembedded / meta-openembedded

MIT License
396 stars 688 forks source link

wx-widgets sdk build not working #311

Open jascase901 opened 3 years ago

jascase901 commented 3 years ago

I can build applications that depend of wx using bitbake. But if I try to make an sdk (bitbake wx-image-sdk -c populate_sdk). and build a sample application get

CMake Error at /opt/tegrademo-mender/3.1+snapshot/sysroots/x86_64-tdsdk-linux/usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /opt/tegrademo-mender/3.1+snapshot/sysroots/x86_64-tdsdk-linux/usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  /opt/tegrademo-mender/3.1+snapshot/sysroots/x86_64-tdsdk-linux/usr/share/cmake-3.18/Modules/FindwxWidgets.cmake:1008 (find_package_handle_standard_args)
  CMakeLists.txt:13 (find_package)

Looking at my sys root directory. there is no wx-config, which is hwat findwxwidgets uses to set the include, and library dirs. There is a wxrc, which is functionally the same thing as wx-config, but trying to use it returns my system wx libraries in /usr/local

gcdcintra commented 2 years ago

I had a similar problem. Solved that by adding DEPENDS += "wxwidgets" to my recipe .bb file.

With that, I could compile the recipe using standard cmake syntax described at wxwidgets docs:

find_package(wxWidgets COMPONENTS core base REQUIRED)
include(${wxWidgets_USE_FILE})
...
target_link_libraries(APP PUBLIC ${wxWidgets_LIBRARIES})
rydhorn commented 1 year ago

Is there an update on this? I'm struggling to build an application with the SDK for my image containing wxWidgets. Same error as @jascase901.

My image .bb contains IMAGE_INSTALL += " wxwidgets" and DEPENDS += " wxwidgets". I'm using Yocto 3.1 Dunfell.

kraj commented 1 year ago

you have to generate the SDK after doing these changes.