How to set CMake with Orocos-bfl in Ubuntu 18.04 - ROS Melodic
Hello, I am building a project that required the use of Orocos-bfl
. I read official documentation where it explains how to incluse Orocos-bfl
into a CMake
project. However without success. I also read this other source where it explains that it is not possible to build my own package against BFL.
So despite trying different options I cannot make my CMake
compile the project with Orocos-bfl
inside my catkin_ws.
See below the project tree structure I have so far and that I am trying to compile:
--catkin_ws
--src
-- project A
-- project B
--pf_localization (this is the project that should use `orocos-bfl`)
--ros_float
--config
--include
--launch
--src
--pf_node.cpp (which is my executable file)
--urdf
--CMakeLists.txt
--package.xml
I think that CMake
is not accepting how I am setting the orocos-bfl
and I am attaching below the CMake
file I am trying to compile:
cmake_minimum_required(VERSION 2.8.3)
project(ros_float)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
find_package(rosbag REQUIRED)
include_directories(${rosbag_INCLUDE_DIRS})
find_package(catkin REQUIRED COMPONENTS
roscpp
sensor_msgs
std_msgs
message_generation
)
find_package(PkgConfig)
pkg_check_modules(BFL REQUIRED orocos-bfl)
include_directories(${BFL_INCLUDE_DIRS}/bfl)
message("BFL include dirs:" ${BFL_INCLUDE_DIRS})
message("BFL library dirs:" ${BFL_LIBRARY_DIRS})
## Build ##
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
message(WARNING ${BFL_INCLUDE_DIRS})
file(GLOB INCLUDES
"include/${PROJECT_NAME}/*.h"
"include/${PROJECT_NAME}/*.cpp"
"include/${PROJECT_NAME}/*.hpp"
)
message(WARNING ${BFL_INCLUDE_DIRS})
link_directories(${BFL_LIBRARY_DIRS})
add_executable(pf_node src/pf_node.cpp ${INCLUDES})
target_link_libraries(pf_node ${BFL_LIBRARIES})
Also, just to cross off a possible doubts, I added <build_depend>bfl</build_depend>
on my package.xml
file
The Error of the compiler is below:
CMake Error at /usr/local/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message):
A required package was not found
Call Stack (most recent call first):
/usr/local/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal)
pf_localization/ros_float/CMakeLists.txt:19 (pkg_check_modules)
Thank you for pointing in the right direction with this issue.