-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (58 loc) · 2.12 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
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.0.2)
project(occupancygrid_creator)
## Compile as C++11, supported in ROS Kinetic and newer
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-deprecated-declarations")
## 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
roscpp
sensor_msgs
nav_msgs
)
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
# Define the current package
catkin_package(
CATKIN_DEPENDS roscpp
sensor_msgs
nav_msgs
geometry_msgs
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)
# Directories to include
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${OPENCV_INCLUDE_DIRS}
${PROJECT_NAME}_gencfg
)
set(LIBRARY_HEADERS ${LIBRARY_HEADERS}
include/${PROJECT_NAME}/occupancygrid_creator.h
)
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
src/occupancygrid_creator.cpp
)
# Add the sources and headers to the library
add_library(${PROJECT_NAME} ${LIBRARY_SOURCES} ${LIBRARY_HEADERS} )
# Link the library to other libraries needed
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} )
# Specify include directories to use when compiling given target
target_include_directories(${PROJECT_NAME} PUBLIC)
# Sometimes need to tell cmake the language we are using
#set_target_properties(lmpcc_solver_lib PROPERTIES LINKER_LANGUAGE CXX)
# Installation rules for the created library
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
# Executable node
add_executable(occupancygrid_creator_node src/occupancygrid_creator_node.cpp)
add_dependencies(occupancygrid_creator_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(occupancygrid_creator_node ${catkin_LIBRARIES} ${PROJECT_NAME})