CMake PkgConfig doesn't work

914 views Asked by At

This works:

pkg-config --libs --cflags glfw3

but

pkg_search_module(GLFW REQUIRED glfw3)

in my CMakeLists.txt does not work. Error message:

-- checking for one of the modules 'glfw3'
CMake Error at /usr/share/cmake-3.2/Modules/FindPkgConfig.cmake:548 (message):
  None of the required 'glfw3' found

I compiled CMake 3.2.3 for Ubuntu 15.04.

1

There are 1 answers

0
Joel On

Try with:

pkg_check_modules (GLFW REQUIRED glfw3)
if (NOT GLFW_FOUND)
# put error here
endif ()