Cmake не видит epoxy lib

Я пытаюсь собрать ORM-SLAM3, однако у меня возникает ошибка привязки:

[ 39%] Linking CXX shared library ../lib/libORB_SLAM3.so
/usr/bin/ld: cannot find -lepoxy::epoxy: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:605: ../lib/libORB_SLAM3.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:192: CMakeFiles/ORB_SLAM3.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

У меня установлена ​​epoxy lib:

$ sudo apt-get install libepoxy-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libepoxy-dev is already the newest version (1.5.10-1).
0 upgraded, 0 newly installed, 0 to remove and 87 not upgraded.

Также у меня есть такие предупреждения:

CMake Warning (dev) at CMakeLists.txt:391 (add_executable):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "stereo_inertial_realsense_D435i_old" links to target "epoxy::epoxy"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

Но CMake не может найти epoxy. Если я добавлю find_package(epoxy REQUIRED) , моя сборка завершится ошибкой:

CMake Error at CMakeLists.txt:46 (find_package):
  By not providing "Findepoxy.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "epoxy", but
  CMake did not find one.

  Could not find a package configuration file provided by "epoxy" with any of
  the following names:

    epoxyConfig.cmake
    epoxy-config.cmake

  Add the installation prefix of "epoxy" to CMAKE_PREFIX_PATH or set
  "epoxy_DIR" to a directory containing one of the above files.  If "epoxy"
  provides a separate development package or SDK, be sure it has been
  installed.

Я не могу найти файл epoxy-config.cmake в своей системе самостоятельно, но, как я показал ранее, epoxy установлен.

Так как это исправить?


348
1

Ответ:

Решено

Решение найдено. Чтобы решить эту проблему необходимо скачать файл из репозитория Pangolin и поместить его в каталог проекта, после этого в CMakeList.txt добавить:

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/)
find_package(epoxy REQUIRED)
include_directories(
${epoxy_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME}
${epoxy_LIBRARIES}
)