-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
113 lines (95 loc) · 3.02 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
PROJECT({{ plugin_name }}Plugin)
{% if not intree -%}
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
{%- endif %}
SET(Plugin_SRCS
{% if add_extension -%}
{{ plugin_name }}ModelExtension.cc
{%- endif %}
{{ plugin_name }}Plugin.cc
)
SET({{ plugin_name }}Plugin_MOC_HDRS
include/toolkit_interfaces.h
{{ plugin_name }}Plugin.h
)
SET(CMAKE_AUTORCC ON )
SET(CMAKE_AUTOUIC ON )
SET(CMAKE_AUTOMOC ON )
{% if not intree -%}
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 )
{%- endif %}
{% if not intree -%}
INCLUDE_DIRECTORIES( ${TOOLKIT_BUILD_PATH} )
INCLUDE_DIRECTORIES( ${TOOLKIT_BUILD_PATH}/include )
INCLUDE_DIRECTORIES( ${TOOLKIT_SOURCE_PATH} )
INCLUDE_DIRECTORIES (${TOOLKIT_SOURCE_PATH}/include)
{%- else -%}
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/include)
{%- endif %}
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})
{% if not intree -%}
FIND_LIBRARY(TOOLKIT_LIB NAMES toolkitlib PATHS ${TOOLKIT_BUILD_PATH})
{%- endif %}
ADD_DEFINITIONS (${QT_DEFINITIONS})
ADD_DEFINITIONS (-DQT_PLUGIN)
ADD_DEFINITIONS (-DQT_SHARED)
ADD_LIBRARY ({{ plugin_name | lower }}plugin SHARED ${Plugin_SRCS})
TARGET_COMPILE_DEFINITIONS ({{ plugin_name | lower }}plugin PRIVATE TOOLKIT_COMPILE_PLUGIN_{{ plugin_name | upper}})
{% if not intree -%}
TARGET_LINK_LIBRARIES ({{ plugin_name | lower }}plugin
${QT_LIBRARIES}
${QT_QTXML_LIBRARY}
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::3DCore
Qt5::3DExtras
Qt5::3DRender
Qt5::3DInput
${RBDL_LIBRARY}
${TOOLKIT_LIB}
)
{%- else -%}
TARGET_LINK_LIBRARIES ({{ plugin_name | lower }}plugin
${QT_LIBRARIES}
${QT_QTXML_LIBRARY}
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::3DCore
Qt5::3DExtras
Qt5::3DRender
Qt5::3DInput
${RBDL_LIBRARY}
toolkitlib
)
{%- endif %}
INSTALL( TARGETS {{ plugin_name | lower }}plugin LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})