forked from Gepetto/gepetto-viewer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
201 lines (176 loc) · 7.55 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
#
# Copyright (c) 2014 LAAS-CNRS
# Authors: Mathieu Geisert
#
#
# This file is part of gepetto-viewer.
# SceneViewer is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# gepetto-viewer is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# gepetto-viewer If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)
SET(PROJECT_NAME gepetto-viewer)
SET(PROJECT_DESCRIPTION "An user-friendly Graphical Interface")
SET(PROJECT_URL "https://github.com/Gepetto/gepetto-viewer")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/ide.cmake)
INCLUDE(cmake/apple.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake-module/qt.cmake)
INCLUDE(cmake-module/osgqt.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
OPTION(ENABLE_QT_DEBUG "Enable Qt debug output." FALSE)
IF(APPLE)
APPLY_DEFAULT_APPLE_CONFIGURATION()
ENDIF(APPLE)
# Declare Headers
SET(${PROJECT_NAME}_HEADERS_MOC
${CMAKE_SOURCE_DIR}/include/gepetto/gui/action-search-bar.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/bodytreewidget.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/dialog/configuration.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/dialog/dialogloadenvironment.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/dialog/dialogloadrobot.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/dialog/pluginmanagerdialog.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/ledindicator.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/mainwindow.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/node-action.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/osgwidget.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/selection-event.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/selection-handler.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/shortcut-factory.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/tree-item.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/windows-manager.hh
)
SET(${PROJECT_NAME}_HEADERS_NO_MOC
${CMAKE_BINARY_DIR}/include/gepetto/gui/config-dep.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/color-map.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/fwd.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/pick-handler.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/qt-osg-keyboard.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/plugin-interface.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/safeapplication.hh
${CMAKE_SOURCE_DIR}/include/gepetto/gui/settings.hh
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/config-osg.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/fwd.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/group-node.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-box.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-capsule.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-collada.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-cone.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-cylinder.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-face.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-ground.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-line.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-mesh.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-sphere.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-light.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-arrow.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/macros.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/node.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/node-drawable.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/urdf-parser.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/window-manager.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/windows-manager.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/leaf-node-xyzaxis.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/roadmap-viewer.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/node-rod.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/node-visitor.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/node-property.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/transform-writer.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/blender-geom-writer.h
${CMAKE_SOURCE_DIR}/include/gepetto/viewer/OSGManipulator/keyboard-manipulator.h
)
SET(${PROJECT_NAME}_RESOURCES ${CMAKE_SOURCE_DIR}/res/images.qrc)
INSTALL(FILES fonts/arial.ttf
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/fonts
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
)
FIND_PACKAGE(X11 REQUIRED)
INCLUDE_DIRECTORIES(SYSTEM ${X11_INCLUDE_DIR})
FIND_PACKAGE(OpenGL REQUIRED)
ADD_REQUIRED_DEPENDENCY("openscenegraph >= 3.2")
ADD_REQUIRED_DEPENDENCY("openthreads >= 2.6")
ADD_OSGQT_DEPENDENCY()
# Must be after ADD_OSGQT_DEPENDENCY
ADD_QT_DEPENDENCY()
ADD_OPTIONAL_DEPENDENCY("qgv")
# {{{ PythonQt settings
FINDPYTHON()
SET(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake-module/
${CMAKE_MODULE_PATH})
# If GEPETTO_GUI_HAS_PYTHONQT is set to TRUE, then PythonQt is required.
IF(DEFINED GEPETTO_GUI_HAS_PYTHONQT AND GEPETTO_GUI_HAS_PYTHONQT)
FIND_PACKAGE(PythonQt REQUIRED)
ELSE()
FIND_PACKAGE(PythonQt)
ENDIF()
# Declare option GEPETTO_GUI_HAS_PYTHONQT
# If GEPETTO_GUI_HAS_PYTHONQT was defined, this does not change its value.
IF (PythonQt_FOUND)
SET(GEPETTO_GUI_HAS_PYTHONQT TRUE CACHE BOOL "Use PythonQt dependency")
SET(BOOST_COMPONENTS python)
ELSE()
SET(GEPETTO_GUI_HAS_PYTHONQT FALSE CACHE BOOL "Use PythonQt dependency")
SET(BOOST_COMPONENTS python)
ENDIF()
IF(GEPETTO_GUI_HAS_PYTHONQT)
SET (${PROJECT_NAME}_HEADERS_MOC
${${PROJECT_NAME}_HEADERS_MOC}
${CMAKE_SOURCE_DIR}/include/gepetto/gui/pythonwidget.hh)
ENDIF(GEPETTO_GUI_HAS_PYTHONQT)
# }}}
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} unit_test_framework system)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
# Check if we are on a platform with ffmpeg or avconv
FIND_PROGRAM(AVCONV avconv)
IF(NOT AVCONV)
FIND_PROGRAM(FFMPEG ffmpeg)
IF(FFMPEG)
SET(AVCONV "${FFMPEG}")
ELSE(FFMPEG)
MESSAGE(WARNING "neither avconv nor ffmpeg have been found.")
# Fallback to old behavior:
# ffmpeg / avconv non-availability at configure time
# doesn't mean anything at run time.
SET(AVCONV "avconv")
ENDIF(FFMPEG)
ENDIF(NOT AVCONV)
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/include/gepetto/gui/config-dep.hh.in
${CMAKE_BINARY_DIR}/include/gepetto/gui/config-dep.hh
@ONLY)
SET(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS_MOC}
${${PROJECT_NAME}_HEADERS_NO_MOC})
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(plugins)
ADD_SUBDIRECTORY(pyplugins)
ADD_SUBDIRECTORY(tests)
# {{{ Packaging
INSTALL(FILES cmake-module/gepetto-viewer-plugin.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake/
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
SET(PKG_CONFIG_EXTRA "${PKG_CONFIG_EXTRA}\ncmake_plugin=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake/gepetto-viewer-plugin.cmake")
FOREACH(lib ${X11_INCLUDE_DIR})
PKG_CONFIG_APPEND_CFLAGS("-I${lib}")
ENDFOREACH(lib ${X11_INCLUDE_DIR})
PKG_CONFIG_APPEND_LIBS_RAW(${X11_LIBRARIES})
PKG_CONFIG_APPEND_LIBS_RAW(${OPENGL_LIBRARIES})
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
# }}}
# vim: foldmethod=marker foldlevel=0