-
Notifications
You must be signed in to change notification settings - Fork 69
/
CMakeLists.txt
67 lines (53 loc) · 1.82 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.0.2)
project(srdfdom)
find_package(Boost REQUIRED)
find_package(console_bridge REQUIRED)
find_package(urdfdom_headers REQUIRED)
find_package(catkin REQUIRED COMPONENTS cmake_modules urdf)
find_package(TinyXML2 REQUIRED)
include_directories(
include
${Boost_INCLUDE_DIR}
${TinyXML2_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${console_bridge_INCLUDE_DIRS}
${urdfdom_headers_INCLUDE_DIRS}
)
catkin_python_setup()
catkin_package(
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS include
DEPENDS TinyXML2 console_bridge urdfdom_headers
)
add_library(${PROJECT_NAME}
src/model.cpp
src/srdf_writer.cpp
)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION})
target_link_libraries(${PROJECT_NAME} ${TinyXML2_LIBRARIES} ${catkin_LIBRARIES} ${console_bridge_LIBRARIES} ${urdfdom_headers_LIBRARIES})
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
install(PROGRAMS
scripts/display_srdf
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(test/srdf_parser.test)
add_definitions(-DTEST_RESOURCE_LOCATION="${CMAKE_SOURCE_DIR}/test/resources")
execute_process(COMMAND bash -c "locale -a | grep -q ^nl_NL"
RESULT_VARIABLE TEST_LOCALE
OUTPUT_QUIET ERROR_QUIET)
if (TEST_LOCALE)
message(STATUS "Locale nl_NL not available. Locale test will not be meaningful.")
endif()
add_rostest_gtest(test_cpp test/srdf_parser_cpp.test test/test_parser.cpp)
target_link_libraries(test_cpp ${catkin_LIBRARIES} ${PROJECT_NAME})
endif()