Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

CMakeLists for plugin compilation

Hello,

I don't relly know how to use CMAKE. I would like to add some more .cc files to compile a model or world plugin for gazebo. Until now, I took the CMakLists.txt file given in the tutorial to compile (with commands "cmake ../" and "make"). I added codes to my plugin by including them as .hh file. But the code starts being pretty big and it takes 30 seconds to compile everytime I make a modification. So does anyone knows how I can modify the CMakeListst.txt file to add some other .cc files ? Here is the my actual one:


cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

find_package(Boost REQUIRED COMPONENTS system)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(GAZEBO gazebo)
endif()
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")

add_library(arm_control SHARED arm_control.cc)
target_link_libraries(arm_control ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES})

Cheers