forked from moveit/warehouse_ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (42 loc) · 1.73 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
cmake_minimum_required(VERSION 2.8.3)
project(warehouse_ros)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
find_package(catkin REQUIRED
geometry_msgs
roscpp
rostest
rostime
std_msgs)
find_package(Boost COMPONENTS system filesystem thread)
find_package(OpenSSL)
find_package(MongoDB)
set(MONGO_EXPORT)
if("${MongoDB_LIBRARIES}" MATCHES "\\.so$")
set(MONGO_EXPORT MongoDB)
endif()
file(MAKE_DIRECTORY "${CATKIN_DEVEL_PREFIX}/include")
catkin_python_setup()
catkin_package(
INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include include
LIBRARIES warehouse_ros
CATKIN_DEPENDS roscpp geometry_msgs rostime std_msgs
DEPENDS Boost ${MONGO_EXPORT}
)
if (NOT MongoDB_EXPOSE_MACROS)
add_definitions(-DMONGO_EXPOSE_MACROS)
endif()
configure_file("include/mongo_ros/config.h.in" "${CATKIN_DEVEL_PREFIX}/include/mongo_ros/config.h")
include_directories(${CATKIN_DEVEL_PREFIX}/include include ${catkin_INCLUDE_DIRS} ${MongoDB_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
link_directories(${catkin_LINK_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
set(warehouse_srcs
src/mongo_ros.cpp
src/mongo_ros_dummy.cpp)
add_library(warehouse_ros SHARED ${warehouse_srcs})
target_link_libraries(warehouse_ros ${catkin_LIBRARIES} ${MongoDB_LIBRARIES} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES})
catkin_add_gtest(test_mongo_roscpp test/test_mongo_ros.cpp)
target_link_libraries(test_mongo_roscpp warehouse_ros)
install(TARGETS warehouse_ros LIBRARY DESTINATION lib)
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
install(PROGRAMS src/mongo_wrapper_ros.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(FILES "${CATKIN_DEVEL_PREFIX}/include/mongo_ros/config.h" DESTINATION include/mongo_ros)