CMakeLists.txt 2.33 KB
Newer Older
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
1
2
cmake_minimum_required(VERSION 2.8.3)
project(homer_mapping)
3
4
add_compile_options(-std=c++14 -fpermissive)

Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

find_package(
	catkin REQUIRED COMPONENTS
		roscpp
		homer_mapnav_msgs
		sensor_msgs
		nav_msgs
		homer_nav_libs
		tf
		roslib
)
find_package(OpenMP)
if (OPENMP_FOUND)
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
find_package(tf REQUIRED)
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
22
find_package(Eigen3 REQUIRED)
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
23

Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
24
25
26
27
28
# eigen 3.2 (wily) only provdies EIGEN3_INCLUDE_DIR, not EIGEN3_INCLUDE_DIRS
if(NOT EIGEN3_INCLUDE_DIRS)
  set(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
endif()

Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
29
30
31
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)

32
33
# Install python imports of this package using catkin
catkin_python_setup()
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
34

Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
35
36
37
38
39
40
set(CMAKE_BUILD_TYPE Release)


include_directories(
	include
	${catkin_INCLUDE_DIRS}
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
41
	${EIGEN3_INCLUDE_DIRS}
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
42
43
	${Qt5Core_INCLUDE_DIRS}
	${Qt5Widgets_INCLUDE_DIRS}
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
44
45
46
47
48
49
50
51
)

catkin_package(
	INCLUDE_DIRS include
	CATKIN_DEPENDS
		roscpp
		homer_mapnav_msgs
		homer_nav_libs
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
52
53
54
		nav_msgs
		tf
		roslib
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
55
	LIBRARIES homerOccupancyMap homerParticleFilter
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
56
57
)

Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
58
add_library(homerOccupancyMap
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
59
60
61
62
63
	src/OccupancyMap/OccupancyMap.cpp
	
)

target_link_libraries(
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
64
	homerOccupancyMap
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
65
66
		${catkin_LIBRARIES}
		${tf_LIBRARIES}
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
67
68
		${Qt5Core_LIBRARIES}
		${Qt5Widgets_LIBRARIES}
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
69
70
71
72
73
74
75
76
77
78
)
set(
	ParticleFilter_SRC
		src/ParticleFilter/HyperSlamFilter.cpp
		src/ParticleFilter/SlamParticle.cpp
		src/ParticleFilter/SlamFilter.cpp
		src/ParticleFilter/Particle.cpp
)

add_library(
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
79
	homerParticleFilter
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
80
81
82
83
		${ParticleFilter_SRC}
)

target_link_libraries(
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
84
	homerParticleFilter
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
85
86
87
88
89
90
91
92
		${catkin_LIBRARIES}
)

add_executable(homer_mapping src/slam_node.cpp)

target_link_libraries(
	homer_mapping
		${catkin_LIBRARIES}
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
93
94
		homerParticleFilter
		homerOccupancyMap
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
95
96
97
98
99
100
)

add_dependencies(
	homer_mapping
		${catkin_EXPORTED_TARGETS}
)
Niklas Yann Wettengel's avatar
fixes    
Niklas Yann Wettengel committed
101
102
103
104
105
106
107
108
109
110

install(DIRECTORY include/${PROJECT_NAME}/
	DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(TARGETS homerOccupancyMap homerParticleFilter homer_mapping
	ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
	LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
	RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Niklas Yann Wettengel's avatar
Niklas Yann Wettengel committed
111
112
113
114
115
116
117
118

install(DIRECTORY launch/
	  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

install(DIRECTORY config/
	  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
)