0

运行 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

实际上,我在运行时检查了 DirectFB 是否已经安装

locate libdirectfb

那么,我该怎么做才能让 CMake 知道 DIrectFB 在哪里呢?一个不方便的限制是我不能在这台机器上执行 sudo ..

谢谢!

4

1 回答 1

0

我猜,您正在尝试在 CMakeLists.txt 文件中使用类似 find_package(directfb) 的内容。只有拥有/usr/share/cmake/Modules/directfb.cmake(Ubuntu 12.04)才能运行。

我的第二个猜测是你在 CMakeLists.txt 文件中使用了类似 pkg_module(directfb) 的东西。只有在某处有 directfb.pc 时才能运行。

否则
你在哪里设置变量 DIRECTFB_INCLUDE_DIR 和 DIRECTFB_LIBRARY。

作为替代步骤,尝试使用find_library(). 您将必须给出 libdirectfb.so 的确切路径并执行类似的操作

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

于 2013-09-06T07:05:13.857 回答