0

I'm trying to include wxWidgets library in my project. I'm working on Ubuntu 16.04. You can get wxWidgets from the repository (already compiled) and just include it by modifying a cmake file (included in CLion). It works fine doing just that.

However, I need to modify the sources and this means that I have to compile the library myself. I followed the instructions from this file: https://github.com/wxWidgets/wxWidgets/blob/v3.1.0/docs/gtk/install.txt

Now Cmake can't find the library. What may be missing?

EDIT:

The part of CMake regarding wxWidgets :

find_package(wxWidgets 3.1.0 COMPONENTS core base media REQUIRED)
include(${wxWidgets_USE_FILE})
target_link_libraries(projectName ${wxWidgets_LIBRARIES})

Error:

CMake Error at /home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find wxWidgets: Found unsuitable version "3.0.2", but required is
at least "3.1.0" (found
-L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_gtk2u_core-3.0;-lwx_baseu-3.0;-
lwx_gtk2u_media-3.0)
Call Stack (most recent call first):
/home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindPackageHandleStandardArgs.cmake:375 (_FPHSA_FAILURE_MESSAGE)
/home/usrName/Clion/clion-2017.2/bin/cmake/share/cmake-
3.8/Modules/FindwxWidgets.cmake:931 (find_package_handle_standard_args)
CMakeLists.txt:18 (find_package)
Zethel
  • 31
  • 5
  • 1
    `Now Cmake can't find the library.` - Show **exact** CMake message about this. – Tsyvarev Aug 28 '17 at 13:25
  • @Tsyvarev I updated the question. The version I need is wxWidgets 3.1.0 not 3.0.2 – Zethel Aug 29 '17 at 09:26
  • Possible duplicate of [Hinting Find.cmake Files with a custom directory](https://stackoverflow.com/questions/34795816/hinting-findname-cmake-files-with-a-custom-directory) – Tsyvarev Aug 29 '17 at 16:02
  • You should probably set the wxWidgets_DIR property to the path of your compiled files before calling ```find_package``` – ahasbini Sep 13 '17 at 22:21

0 Answers0