Installed library cannot be found by CMake

710 views Asked by At

I have the following problem when running CMake.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
DIRECTFB_INCLUDE_DIR (ADVANCED)
  used as include directory in directory /u/menie482/workspace/AtariTEXPLORE
  used as include directory in directory /u/menie482/workspace/AtariTEXPLORE/rl_common
  used as include directory in directory /u/menie482/workspace/AtariTEXPLORE/rl_agent
  used as include directory in directory /u/menie482/workspace/AtariTEXPLORE/rl_env
DIRECTFB_LIBRARY (ADVANCED)
  linked by target "experiment" in directory /u/menie482/workspace/AtariTEXPLORE

Actually, I have checked that the DirectFB is already installed when running

locate libdirectfb

So, what shall I do to let CMake know where DIrectFB is? An inconvenient constraint is that I cannot do sudo on this machine..

Thanks!

1

There are 1 answers

0
user2618142 On

I guess, you are trying to use something like find_package(directfb) in your CMakeLists.txt file. That can only run if you have /usr/share/cmake/Modules/directfb.cmake (Ubuntu 12.04).

My second guess is you are using something like pkg_module(directfb) in your CMakeLists.txt file. That can only run if you have directfb.pc somewhere.

Otherwise
Where are you setting the variables DIRECTFB_INCLUDE_DIR and DIRECTFB_LIBRARY.

As an alternate step, try using find_library(). You will have to give exact path of libdirectfb.so and do something like

find_library(DIRECT_FB NAMES directfb PATHS path/directfb.so )
target_link_libraries( MyLibraryOrMyExecutable ${DIRECT_FB} )