1
- cmake_minimum_required (VERSION 3.0.2 )
1
+ cmake_minimum_required (VERSION 3.1 )
2
2
project (rviz_aerial_map)
3
3
4
4
set (RVIZ_AERIAL_MAP_VERSION "1.0.0" )
5
+ set (CMAKE_CXX_STANDARD 11)
6
+ set (CMAKE_AUTOMOC ON )
5
7
6
- # ROS dependencies
7
8
find_package (catkin REQUIRED COMPONENTS
8
9
roscpp
9
- roslint
10
10
rviz
11
11
sensor_msgs
12
12
ogre_primitives
13
13
tas_proj)
14
14
15
15
# System dependencies
16
16
find_package (GDAL)
17
- find_package (Boost REQUIRED)
18
- find_package (Qt5 COMPONENTS Core Gui Network Concurrent REQUIRED)
19
- find_package (PkgConfig REQUIRED)
20
- pkg_check_modules(OGRE_OV OGRE OGRE-Overlay)
21
- # Old versions of OGRE (pre 1.9) included OGRE-Overlay in the main package
22
- # (i.e. there was no OGRE-Overlay component). So if the above
23
- # pkg_check_modules() failed, try looking for just OGRE.
24
- if (NOT OGRE_OV_FOUND)
25
- pkg_check_modules(OGRE_OV REQUIRED OGRE)
26
- endif ()
27
17
28
18
###################################
29
19
## catkin specific configuration ##
@@ -33,7 +23,7 @@ catkin_package(
33
23
INCLUDE_DIRS include
34
24
LIBRARIES map_helper
35
25
CATKIN_DEPENDS tas_proj
36
- DEPENDS Qt5Core GDAL Boost )
26
+ DEPENDS GDAL)
37
27
38
28
###########
39
29
## Build ##
@@ -42,16 +32,27 @@ catkin_package(
42
32
include_directories (
43
33
include
44
34
${catkin_INCLUDE_DIRS}
45
- ${Qt5Core_INCLUDE_DIRS}
46
- ${Qt5Gui_INCLUDE_DIRS}
47
- ${Qt5Network_INCLUDE_DIRS}
48
- ${Qt5Concurrent_INCLUDE_DIRS}
49
35
${GDAL_INCLUDE_DIRS}
50
- ${BOOST_INCLUDE_DIRS}
51
- ${OGRE_OV_INCLUDE_DIRS}
52
- ${CMAKE_CURRENT_BINARY_DIR}
53
36
)
54
37
38
+ ## This plugin includes Qt widgets, so we must include Qt.
39
+ ## We'll use the version that rviz used so they are compatible.
40
+ if (rviz_QT_VERSION VERSION_LESS "5" )
41
+ message (STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
42
+ find_package (Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui QtNetwork)
43
+ ## pull in all required include dirs, define QT_LIBRARIES, etc.
44
+ include (${QT_USE_FILE} )
45
+ else ()
46
+ message (STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
47
+ find_package (Qt5 COMPONENTS Core Widgets Network REQUIRED)
48
+ ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
49
+ set (QT_LIBRARIES Qt5::Widgets Qt5::Network)
50
+ endif ()
51
+
52
+ ## I prefer the Qt signals and slots to avoid defining "emit", "slots",
53
+ ## etc because they can conflict with boost signals, so define QT_NO_KEYWORDS here.
54
+ add_definitions (-DQT_NO_KEYWORDS)
55
+
55
56
# Build map helper library
56
57
add_library (map_helper
57
58
src/map_helpers/tiff_tile_helper.cpp
@@ -65,38 +66,25 @@ target_link_libraries(map_helper
65
66
)
66
67
67
68
# Build rviz plugin library
68
- add_definitions ("-Wall -Wunused -std=c++11 -DRVIZ_AERIAL_MAP_VERSION=\"\\\" ${RVIZ_AERIAL_MAP_VERSION} \\\"\" " )
69
- set (${PROJECT_NAME} _HEADERS
70
- src/aerial_map_display.h
71
- src/vis_helpers/image_downloader.h
72
- )
73
- qt5_wrap_cpp(${PROJECT_NAME} _MOCSrcs ${${PROJECT_NAME} _HEADERS})
69
+ add_definitions ("-DRVIZ_AERIAL_MAP_VERSION=\"\\\" ${RVIZ_AERIAL_MAP_VERSION} \\\"\" " )
74
70
75
71
add_library (${PROJECT_NAME}
76
72
src/aerial_map_display.cpp
77
73
src/vis_helpers/image_downloader.cpp
78
74
src/vis_helpers/texture_cache.cpp
79
- ${${PROJECT_NAME} _MOCSrcs}
80
- )
81
- target_link_libraries (${PROJECT_NAME}
82
- ${catkin_LIBRARIES}
83
- ${Qt5Core_LIBRARIES}
84
- ${Qt5Gui_LIBRARIES}
85
- ${Qt5Network_LIBRARIES}
86
- ${Qt5Concurrent_LIBRARIES}
87
- map_helper
88
75
)
76
+ target_link_libraries (${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES} map_helper)
89
77
90
- roslint_cpp( )
78
+ add_dependencies ( ${PROJECT_NAME} ${ ${PROJECT_NAME} _EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} )
91
79
92
80
#############
93
81
## Install ##
94
82
#############
95
83
96
84
install (TARGETS ${PROJECT_NAME}
97
- RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
98
- ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
99
- LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
100
- )
85
+ RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
86
+ ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
87
+ LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
88
+ )
101
89
102
90
install (FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} )
0 commit comments