-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
85 lines (67 loc) · 2.31 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
cmake_minimum_required(VERSION 2.8.3)
project(waypoint_navigation_plugin)
find_package(yaml-cpp REQUIRED)
find_package(catkin REQUIRED COMPONENTS rviz rosbag)
catkin_package()
include_directories(${catkin_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS})
if(rviz_QT_VERSION VERSION_LESS "5")
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
else()
find_package(Qt5 REQUIRED COMPONENTS Core Widgets OpenGL)
# set variable names already used with Qt4
set(QT_LIBRARIES Qt5::Widgets)
set(QTVERSION ${Qt5Widgets_VERSION})
endif()
## Qt signals and slots to avoid defining "emit", "slots",
## etc because they can conflict with boost signals, so define QT_NO_KEYWORDS here.
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frounding-math -Werror=return-type")
if(rviz_QT_VERSION VERSION_LESS "5")
# Header files that need Qt Moc pre-processing for use with Qt signals, etc:
qt4_wrap_cpp(MOC_FILES
src/waypoint_nav_frame.h
src/waypoint_nav_tool.h
)
# Convert the Qt Signals and Slots for QWidget events
qt4_wrap_ui(UIC_FILES
ui/WaypointNavigation.ui
)
else()
# Header files that need Qt Moc pre-processing for use with Qt signals, etc:
qt5_wrap_cpp(MOC_FILES
src/waypoint_nav_frame.h
src/waypoint_nav_tool.h
)
# Convert the Qt Signals and Slots for QWidget events
qt5_wrap_ui(UIC_FILES
ui/WaypointNavigation.ui
)
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Plugin Source
set(SOURCE_FILES
src/waypoint_nav_frame.cpp
src/waypoint_nav_tool.cpp
${MOC_FILES}
)
set(LIB_NAME waypoint_nav_plugin)
add_library(${LIB_NAME} ${SOURCE_FILES} ${MOC_SOURCES} ${UIC_FILES})
target_link_libraries(${LIB_NAME}
${catkin_LIBRARIES} ${QT_LIBRARIES} ${YAML_CPP_LIBRARIES})
## Install rules
install(DIRECTORY src/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")
install(TARGETS ${LIB_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
## Install rules
install(FILES
waypoint_nav_plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY media/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/media)
install(DIRECTORY icons/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/icons)