forked from nobleo/rviz_satellite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
108 lines (89 loc) · 2.45 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
cmake_minimum_required(VERSION 2.8.3)
project(rviz_satellite)
set(DISTRO $ENV{ROS_DISTRO})
message(STATUS "Distribution: " ${DISTRO})
set(DEFAULT_BUILD_QT5 OFF)
if(${DISTRO} STREQUAL "kinetic" OR ${DISTRO} STREQUAL "lunar" OR ${DISTRO} STREQUAL "melodic")
set(DEFAULT_BUILD_QT5 ON)
endif()
option(UseQt5 "Build w/ QT version 5" ${DEFAULT_BUILD_QT5})
if (UseQt5)
find_package(Qt5 COMPONENTS Core Gui Network Concurrent REQUIRED)
else()
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
include(${QT_USE_FILE})
endif()
find_package(OpenCV REQUIRED)
find_package(PkgConfig REQUIRED)
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()
find_package(catkin REQUIRED COMPONENTS
nav_msgs
roscpp
rviz
sensor_msgs
)
catkin_package(CATKIN_DEPENDS nav_msgs sensor_msgs)
set(${PROJECT_NAME}_SOURCES
src/aerialmap_display.cpp
src/tileloader.cpp
)
set(${PROJECT_NAME}_HEADERS
src/aerialmap_display.h
src/tileloader.h
)
# invoke MOC and UI/ include Qt headers/ link Qt libraries
if (UseQt5)
qt5_wrap_cpp(${PROJECT_NAME}_MOCSrcs ${${PROJECT_NAME}_HEADERS})
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Concurrent_INCLUDE_DIRS}
)
link_libraries(
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
)
else()
qt4_wrap_cpp(${PROJECT_NAME}_MOCSrcs ${${PROJECT_NAME}_HEADERS})
include_directories(${Qt4_INCLUDE_DIR})
link_libraries(
${QT_LIBRARIES}
)
endif()
# Other includes
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${OpenCV_INCLUDE_DIR}
${OGRE_OV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
src
)
# Other libraries
link_libraries(
${QT_LIBRARIES}
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
)
add_definitions("-Wall -Wunused -std=c++11")
set(PROJECT_SOURCE_FILES
${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_MOCSrcs}
)
add_library(${PROJECT_NAME}
${PROJECT_SOURCE_FILES}
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})