-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
82 lines (65 loc) · 2.3 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
PROJECT(ImuPositionPlugin)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
SET(Plugin_SRCS
ImuPositionModelExtension.cc
ImuPositionPlugin.cc
)
SET(ImuPositionPlugin_MOC_HDRS
include/toolkit_interfaces.h
ImuPositionPlugin.h
)
SET(CMAKE_AUTORCC ON )
SET(CMAKE_AUTOUIC ON )
SET(CMAKE_AUTOMOC ON )
SET(TOOLKIT_SOURCE_PATH "" CACHE PATH "Path to Toolkit Source Code")
SET(TOOLKIT_BUILD_PATH "" CACHE PATH "Path to Toolkit Build Dir")
if(TOOLKIT_BUILD_PATH)
else()
MESSAGE( FATAL_ERROR "You need to supply the path to the build dir of the toolkit, since you will require certain headers generated during the build process!")
endif()
if(TOOLKIT_SOURCE_PATH)
else()
MESSAGE( FATAL_ERROR "You need to supply the path to the toolkit source code")
endif()
LIST( APPEND CMAKE_MODULE_PATH ${TOOLKIT_SOURCE_PATH}/cmake )
SET(CUSTOM_QT_PATH "" CACHE PATH "Path to Qt Installation")
IF (CUSTOM_QT_PATH)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_PREFIX_PATH "${CUSTOM_QT_PATH}/lib/cmake")
ENDIF(CUSTOM_QT_PATH)
FIND_PACKAGE (Qt5 REQUIRED COMPONENTS Core Gui Widgets 3DCore 3DExtras 3DRender 3DInput)
FIND_PACKAGE (RBDL COMPONENTS LUAMODEL REQUIRED)
FIND_PACKAGE (Eigen3 REQUIRED)
SET( PLUGIN_INSTALL_DIR share/ORB/rbdl-toolkit/plugins )
INCLUDE_DIRECTORIES( ${TOOLKIT_BUILD_PATH} )
INCLUDE_DIRECTORIES( ${TOOLKIT_BUILD_PATH}/include )
INCLUDE_DIRECTORIES( ${TOOLKIT_SOURCE_PATH} )
INCLUDE_DIRECTORIES (${TOOLKIT_SOURCE_PATH}/include)
INCLUDE_DIRECTORIES (${QT_INCLUDE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES (${RBDL_INCLUDE_DIR})
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR})
ADD_DEFINITIONS (${QT_DEFINITIONS})
ADD_DEFINITIONS (-DQT_PLUGIN)
ADD_DEFINITIONS (-DQT_SHARED)
FIND_LIBRARY(TOOLKIT_LIB NAMES toolkitlib PATHS ${TOOLKIT_BUILD_PATH})
ADD_LIBRARY (imupositionplugin SHARED ${Plugin_SRCS})
TARGET_LINK_LIBRARIES (imupositionplugin
${QT_LIBRARIES}
${QT_QTXML_LIBRARY}
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::3DCore
Qt5::3DExtras
Qt5::3DRender
Qt5::3DInput
${RBDL_LIBRARY}
${TOOLKIT_LIB}
)
INSTALL( TARGETS imupositionplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})