CMake Ошибка: не удалось найти файл загрузки - PullRequest
1 голос
/ 27 января 2020

Я пытаюсь установить и использовать библиотеку "ifopt" в проекте, но я получаю некоторые ошибки

Я использовал следующие команды (как здесь: https://github.com/ethz-adrl/ifopt/blob/master/README.md) :

sudo apt-get install cmake libeigen3-dev coinor-libipopt-dev
git clone https://github.com/ethz-adrl/ifopt.git
cd ifopt
mkdir build 
cd build
cmake ..
make
sudo make install

Затем я добавил в свои списки CMakeList:

find_package(ifopt)
add_executable(testifopt src/testifopt.cpp)
target_link_libraries(testifopt PUBLIC ifopt::ifopt_ipopt) 

И вот что я получаю, используя catkin_make:

CMake Error at /home/simone/ifopt/ifopt-config.cmake:40 (include): include could not find load file: /home/simone/ifopt/ifopt_core-targets.cmake    
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)


CMake Warning (dev) at /home/simone/ifopt/ifopt-config.cmake:44 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target "ifopt::ifopt_core".
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /home/simone/ifopt/ifopt-config.cmake:47 (get_property): get_property could not find TARGET ifopt::ifopt_core. Perhaps it has not yet been created.
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)

Что не так? Спасибо за вашу помощь.

1 Ответ

0 голосов
/ 30 января 2020

Решено,

Мне нужно обновить Ros, переустановить IfOpt, а также я добавил в CMakeLists эту строку:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")
...