forked from CorentinChauvin/PlotJuggler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
211 lines (165 loc) · 6.62 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
206
207
208
project(plotjuggler)
cmake_minimum_required(VERSION 2.8)
# http://answers.ros.org/question/230877/optionally-build-a-package-with-catkin/
if( CATKIN_DEVEL_PREFIX OR catkin_FOUND OR CATKIN_BUILD_BINARY_PACKAGE)
set(COMPILING_WITH_CATKIN 1)
endif()
SET(PLOTJUGGLER_VERSION_MAJOR 1)
SET(PLOTJUGGLER_VERSION_MINOR 8)
SET(PLOTJUGGLER_VERSION_PATCH 4)
add_definitions(
-DPJ_MAJOR_VERSION=${PLOTJUGGLER_VERSION_MAJOR}
-DPJ_MINOR_VERSION=${PLOTJUGGLER_VERSION_MINOR}
-DPJ_PATCH_VERSION=${PLOTJUGGLER_VERSION_PATCH} )
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -fno-omit-frame-pointer")
if(APPLE AND EXISTS /usr/local/opt/qt5)
# Homebrew installs Qt5 (up to at least 5.9.1) in
# /usr/local/qt5, ensure it can be found by CMake since
# it is not in the default /usr/local prefix.
# source: https://github.com/Homebrew/homebrew-core/issues/8392#issuecomment-325226494
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
set(CMAKE_MACOSX_RPATH 1)
endif()
find_package(Qt5 REQUIRED COMPONENTS Core Widgets PrintSupport Concurrent Xml Qml)
find_package(Qt5 QUIET COMPONENTS Svg)
find_package(Qt5 QUIET COMPONENTS WebSockets)
set( QT_LINK_LIBRARIES
Qt5::Core
Qt5::Widgets
Qt5::PrintSupport
Qt5::Xml
Qt5::Concurrent
Qt5::Qml
)
if( NOT Qt5Svg_FOUND)
message(STATUS "Can't find Qt5Svg in your system. Have you tried [sudo apt-get install libqt5svg5-dev] ?")
add_definitions( -DQWT_NO_SVG )
else()
set( QT_LINK_LIBRARIES ${QT_LINK_LIBRARIES} Qt5::Svg)
endif()
if( NOT Qt5WebSockets_FOUND)
message(STATUS "Can't find Qt5WebSockets in your system. Have you tried [sudo apt-get install libqt5websockets5-dev] ?")
add_definitions( -DQWT_NO_SVG )
else()
set( QT_LINK_LIBRARIES ${QT_LINK_LIBRARIES} Qt5::WebSockets)
endif()
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to RelWithDebInfo")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if(COMPILING_WITH_CATKIN)
message(STATUS "---------------------------------------------------------------------")
message(STATUS "PlotJuggler is being built using CATKIN. ROS plugins will be compiled")
message(STATUS "---------------------------------------------------------------------")
find_package(catkin REQUIRED COMPONENTS
rosbag
rosbag_storage
roscpp
roscpp_serialization
ros_type_introspection
rostime
topic_tools
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS ros_type_introspection
DEPENDS
)
INCLUDE_DIRECTORIES( ${catkin_INCLUDE_DIRS} )
endif()
IF (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
include_directories(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Concurrent_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS}
${Qt5WebSockets_INCLUDE_DIRS}
)
include_directories( ./qwt/src
./include
./color_widgets/include )
if(COMPILING_WITH_CATKIN)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY site/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/docs )
install(DIRECTORY docs/images DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/docs )
add_definitions( -DPJ_DOCUMENTATION_DIR="${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/docs" )
else()
set(CMAKE_INSTALL_PREFIX "/usr/local")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
install(DIRECTORY site/ DESTINATION ${CMAKE_BINARY_DIR}/share/docs )
install(DIRECTORY docs/images DESTINATION ${CMAKE_BINARY_DIR}/share/docs )
add_definitions( -DPJ_DOCUMENTATION_DIR="${CMAKE_INSTALL_PREFIX}/share/docs" )
endif()
add_subdirectory(backward-cpp)
add_subdirectory( color_widgets )
add_subdirectory( qwt/src )
add_subdirectory( plotter_gui )
add_subdirectory( plugins/DataLoadCSV )
add_subdirectory( plugins/DataStreamSample )
if (Qt5Widgets_VERSION VERSION_LESS 5.3.0)
message(STATUS "Minimum Qt5 version for DataStreamWebSocket plugin is 5.3. Skipping plugins/DataStreamWebSocket")
else()
if( NOT Qt5WebSockets_FOUND)
message(STATUS "Qt5WebSockets not found. Skipping plugins/DataStreamWebSocket")
else()
add_subdirectory( plugins/DataStreamWebSocket )
endif()
endif()
if(COMPILING_WITH_CATKIN)
add_subdirectory( plugins/ROS )
endif()
######################### create a package ####################################
SET(CPACK_PACKAGE_CONTACT "davide.faconti@gmail.com")
SET(CPACK_PACKAGE_NAME "plotjuggler${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PlotJuggler: juggle with data")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PLOTJUGGLER_VERSION_MAJOR} )
SET(CPACK_PACKAGE_VERSION_MINOR ${PLOTJUGGLER_VERSION_MINOR} )
SET(CPACK_PACKAGE_VERSION_PATCH ${PLOTJUGGLER_VERSION_PATCH} )
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
SET(CPACK_PACKAGE_VENDOR "Icarus Technology")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "PlotJuggler")
INCLUDE(CPack)
IF (NOT WIN32)
SET(CPACK_GENERATOR "TGZ;DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Davide Faconti")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "qt5-default, libqt5svg5-dev")
else()
include(CPackIFW)
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
install(FILES
${QT_DLL_DIR}/Qt5Core.dll
${QT_DLL_DIR}/Qt5Gui.dll
${QT_DLL_DIR}/Qt5Widgets.dll
${QT_DLL_DIR}/Qt5Xml.dll
${QT_DLL_DIR}/Qt5Svg.dll
${QT_DLL_DIR}/libgcc_s_dw2-1.dll
${QT_DLL_DIR}/libwinpthread-1.dll
${QT_DLL_DIR}/libstdc++-6.dll
DESTINATION ./bin
)
install(FILES
${QT_DLL_DIR}/../plugins/platforms/qwindows.dll
DESTINATION plugins/platforms
)
CPACK_ADD_COMPONENT(PlotJuggler
DISPLAY_NAME "PlotJuggler"
DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}" )
CPACK_IFW_CONFIGURE_COMPONENT(PlotJuggler
VERSION "${CPACK_PACKAGE_VERSION}"
LICENSES "LGPL" "${CMAKE_SOURCE_DIR}/LICENSE")
endif()