cmake on mac fails with (missing: wxWidgets_LIBRARIES)
Posted: Thu Jun 18, 2020 6:39 am
I'm trying to use wxWidgets with cmake on mac so I had to build it from sources.
The installation was successful and I was able to build the samples and demos as well.
wx-config for libs
In the CMakeLists.txt I added
But when I run cmake on my project with the following command
* I used /..../ as simplification for the users folder structure.
Code: Select all
git clone https://github.com/wxWidgets/wxWidgets
cd wxWidgets
mkdir build-cocoa-osx
cd build-cocoa-osx
../configure --enable-debug
make -j 8
make install
Code: Select all
./wx-config --cxxflags
-I/..../wxWidgets/build-cocoa-debug/lib/wx/include/osx_cocoa-unicode-3.1 -I/..../wxWidgets/include -D_FILE_OFFSET_BITS=64 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__
Code: Select all
./wx-config --libs
-L/..../wxWidgets/build-cocoa-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.1 -lwx_osx_cocoau_html-3.1 -lwx_osx_cocoau_qa-3.1 -lwx_osx_cocoau_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
Code: Select all
find_package(wxWidgets REQUIRED core base HINT ${wxWidgets_ROOT_DIR})
message(STATUS "wxWidgets library:")
Code: Select all
cmake -G "Unix Makefiles" -DwxWidgets_ROOT_DIR=/..../wxWidgets/build-cocoa-osx -DwxWidgets_LIB_DIR=/..../wxWidgets/build-cocoa-osx/lib . -B build
CMake Error at /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindwxWidgets.cmake:1008 (find_package_handle_standard_args)
CMakeLists.txt:66 (find_package)
* I used /..../ as simplification for the users folder structure.