Gazebo | Ignition | Community
Ask Your Question
0

How to include ignition math library in CMakeLists.txt?

asked 2019-05-21 00:08:23 -0600

rahul gravatar image

I am not sure if this is the right platform to ask this question, but I know that ignition math has been forked from Gazebosim project. For a personal project, I want to use ignition math library from https://ignitionrobotics.org/api/math.... I am not sure how to put include this library in CMakeLists.txt so that my Makefile generated from cmake . may able to build my project.

Can anyone help me in this manner?

Currently, my CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 2.8.3)
project(ACE)

#The Version number
set (ACE_VERSION MAJOR 0)
set (ACE_VERSION MINOR 1)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages

find_package(catkin REQUIRED COMPONENTS
)

## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)

# Need to have these in order to find/include boost stuff
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

include_directories(include
src
)

add_executable(ACE ace.cpp
include/ACEConstant.h
include/ACETypes.h
include/ACEGrid.h
include/util.h
src/ACEGrid.cpp
src/util.cpp
)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-05-30 10:35:58 -0600

azeey gravatar image

Ignition math provides cmake package configuration files so, assuming you're using version 6, you can call find_package(ignition-math6 REQUIRED) and link against the library via target_link_libraries(ACE ignition-math6::ignition-math6)

You can find an example CMakeLists.txt file at https://bitbucket.org/ignitionrobotic...

edit flag offensive delete link more

Comments

It looks like the example CMakeLists.txt link is no longer working, since the Ignition project moved to GitHub. Here's an updated link to an example CMakeLists.txt: https://github.com/ignitionrobotics/i...

adlarkin gravatar imageadlarkin ( 2020-12-18 13:48:00 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-05-21 00:08:23 -0600

Seen: 1,870 times

Last updated: May 30 '19