forked from ros-visualization/rviz
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
205 lines (178 loc) · 4.83 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
cmake_minimum_required(VERSION 2.8.3)
project(rviz)
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
find_package(Boost REQUIRED
COMPONENTS
filesystem
program_options
signals
system
thread
)
find_package(PkgConfig REQUIRED)
find_package(ASSIMP QUIET)
if (NOT ASSIMP_FOUND)
pkg_check_modules(ASSIMP assimp)
endif()
if (ASSIMP_FOUND)
if( NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150" )
add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES)
message(STATUS "Assimp version has unified headers")
else()
message(STATUS "Assimp version does not have unified headers")
endif()
include_directories(${ASSIMP_INCLUDE_DIRS})
link_directories(${ASSIMP_LIBRARY_DIRS})
else()
message(STATUS "could not find assimp (perhaps available thorugh ROS package?), so assimping assimp v2")
set(ASSIMP_LIBRARIES assimp)
set(ASSIMP_LIBRARY_DIRS)
set(ASSIMP_CXX_FLAGS)
set(ASSIMP_CFLAGS_OTHER)
set(ASSIMP_LINK_FLAGS)
set(ASSIMP_INCLUDE_DIRS)
endif()
pkg_check_modules(OGRE_OV OGRE OGRE-Overlay)
# Old versions of OGRE (pre 1.9) included OGRE-Overlay in the main package
# (i.e. there was no OGRE-Overlay component). So if the above
# pkg_check_modules() failed, try looking for just OGRE.
if(NOT OGRE_OV_FOUND)
pkg_check_modules(OGRE_OV REQUIRED OGRE)
endif(NOT OGRE_OV_FOUND)
## Find OGRE Plugin path (not necessarily platform-independent, I guess)
execute_process(COMMAND
pkg-config --variable=plugindir OGRE
OUTPUT_VARIABLE OGRE_PLUGIN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS OGRE_PLUGIN_PATH=${OGRE_PLUGIN_PATH})
# find absolute path of ogre libraries.
# This is stored in the cache to save time on cmake re-run.
# Using absolute paths is necessary if pkg-config finds Ogre in a different
# location than the default. This can happen when Ogre is built from source,
# or when 2 versions of Ogre are installed. Using absolute paths ensures that
# components that link against Ogre (rviz and any packages depending on rviz)
# all find the same Ogre shared library.
if(NOT DEFINED OGRE_OV_LIBRARIES_ABS)
unset(OGRE_OV_LIBRARIES_ABS_TMP)
foreach(_lib ${OGRE_OV_LIBRARIES})
set(OGRE_OV_LIB_TAG "OGRE_OV_RVIZ_LIB_${_lib}")
find_library(${OGRE_OV_LIB_TAG}
NAMES ${_lib}
HINTS ${OGRE_OV_LIBRARY_DIRS}
PATHS ${OGRE_OV_LIBRARY_DIRS}
)
set(OGRE_OV_LIBRARIES_ABS_TMP ${OGRE_OV_LIBRARIES_ABS_TMP} ${${OGRE_OV_LIB_TAG}})
endforeach(_lib)
set(OGRE_OV_LIBRARIES_ABS ${OGRE_OV_LIBRARIES_ABS_TMP}
CACHE FILEPATH "Pathname of library ${_lib}")
endif(NOT DEFINED OGRE_OV_LIBRARIES_ABS)
if(APPLE)
FIND_LIBRARY(Cocoa_LIBRARIES Cocoa)
set(rviz_ADDITIONAL_LIBRARIES ${Cocoa_LIBRARIES})
endif()
find_package(OpenGL REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui QtOpenGL)
find_package(catkin REQUIRED
COMPONENTS
angles
cmake_modules
geometry_msgs
image_geometry
image_transport
interactive_markers
laser_geometry
map_msgs
message_filters
nav_msgs
pluginlib
python_qt_binding
resource_retriever
rosbag
rosconsole
roscpp
roslib
rospy
sensor_msgs
std_msgs
std_srvs
tf
urdf
visualization_msgs
)
if(${tf_VERSION} VERSION_LESS "1.11.3")
add_definitions("-DRVIZ_USE_BOOST_SIGNAL_1")
endif()
find_package(Eigen REQUIRED)
catkin_python_setup()
if(NOT OGRE_OV_LIBRARIES_ABS)
set(OGRE_OV_LIBRARIES_ABS ${OGRE_OV_LIBRARIES})
endif()
catkin_package(
INCLUDE_DIRS
src
${EIGEN_INCLUDE_DIRS}
${OGRE_OV_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
LIBRARIES
rviz
default_plugin
${OGRE_OV_LIBRARIES_ABS}
${rviz_ADDITIONAL_LIBRARIES}
${OPENGL_LIBRARIES}
CATKIN_DEPENDS
geometry_msgs
image_geometry
image_transport
interactive_markers
laser_geometry
map_msgs
message_filters
nav_msgs
pluginlib
resource_retriever
roscpp
roslib
sensor_msgs
std_msgs
tf
urdf
visualization_msgs
)
include_directories(SYSTEM
${EIGEN_INCLUDE_DIRS}
${OGRE_OV_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH}
)
include_directories(src ${catkin_INCLUDE_DIRS})
include(${QT_USE_FILE})
add_definitions(-DQT_NO_KEYWORDS)
#### If gtk ends up being the best way to get the correct window
#### position under X11, this is how to compile it in.
#
# find_package(GTK2)
# include_directories(${GTK2_INCLUDE_DIRS})
# include_directories(/usr/include/gdk-pixbuf-2.0)
add_subdirectory(src)
install(DIRECTORY ogre_media
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY icons
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY images
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES default.rviz
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)