Skip to content

Commit

Permalink
Clean up dependencies and CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es committed Jul 11, 2017
1 parent 66af764 commit 0074135
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
39 changes: 25 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.1)
project(dr_kdl)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_EXTENSIONS off)
add_compile_options(-Wall -Wextra -Wpedantic)

find_package(catkin REQUIRED COMPONENTS
sensor_msgs
kdl_parser
dr_base
dr_eigen
)

find_package(orocos_kdl REQUIRED)
find_package(Eigen3 REQUIRED)

catkin_package(
INCLUDE_DIRS include ${orocos_kdl_INCLUDE_DIRS}
LIBRARIES ${PROJECT_NAME} ${orocos_kdl_LIBRARIES}
CATKIN_DEPENDS dr_eigen
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS sensor_msgs
DEPENDS EIGEN3 orocos_kdl
)

dr_include_directories(
include/${PROJECT_NAME}
include_directories(include/${PROJECT_NAME})
include_directories(SYSTEM
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME}
src/dr_kdl.cpp
)

target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Eigen_LIBRARIES} ${orocos_kdl_LIBRARIES})
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${EIGEN3_LIBRARIES}
${orocos_kdl_LIBRARIES}
)

dr_add_gtest(kdl test/kdl.cpp)
dr_add_gtest(eigen test/eigen.cpp)
target_link_libraries(${PROJECT_NAME}_test_kdl ${PROJECT_NAME} ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_test_eigen ${PROJECT_NAME} ${catkin_LIBRARIES})
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(${PROJECT_NAME}_test_kdl test/kdl.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_eigen test/eigen.cpp)
target_link_libraries(${PROJECT_NAME}_test_kdl ${PROJECT_NAME} ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_test_eigen ${PROJECT_NAME} ${catkin_LIBRARIES})
endif()

install(
TARGETS "${PROJECT_NAME}"
Expand Down
5 changes: 3 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<author email="[email protected]">Maarten de Vries</author>

<buildtool_depend>catkin</buildtool_depend>
<depend>dr_base</depend>
<depend>dr_eigen</depend>
<depend>eigen</depend>
<depend>kdl_parser</depend>
<depend>orocos_kdl</depend>
<depend>sensor_msgs</depend>
</package>

0 comments on commit 0074135

Please sign in to comment.