-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
219 lines (189 loc) · 5.23 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
209
210
211
212
213
214
215
216
217
218
219
PROJECT ( PUPPETEER )
CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
# Needed for UnitTest++
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
# Perform the proper linking
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)
# Enable proper C++11 flags
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()
# Qt Setup
SET( QT_USE_QTXML TRUE )
SET( QT_USE_QTOPENGL TRUE )
SET( QT_WRAP_CPP TRUE )
FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Qt5OpenGL)
FIND_PACKAGE (Qt5Core)
INCLUDE_DIRECTORIES (${Qt5Core_INCLUDE_DIRS})
INCLUDE_DIRECTORIES (${Qt5Widgets_INCLUDE_DIRS})
INCLUDE_DIRECTORIES (${Qt5OpenGL_INCLUDE_DIRS})
SET( VTK_QT_VERSION "5")
FIND_PACKAGE (VTK REQUIRED)
FIND_PACKAGE (Lua REQUIRED)
FIND_PACKAGE (OpenGL)
FIND_PACKAGE (RBDL COMPONENTS LuaModel REQUIRED)
FIND_PACKAGE (Eigen3 REQUIRED)
INCLUDE (${VTK_USE_FILE})
ADD_DEFINITIONS (${QT_DEFINITIONS})
QT5_WRAP_UI (PuppeteerMainWindow_UIS_H
${CMAKE_CURRENT_SOURCE_DIR}/ui/PuppeteerMainWindow.ui
${CMAKE_CURRENT_SOURCE_DIR}/ui/PuppeteerAboutDialog.ui
)
MESSAGE (STATUS "out ${PuppeteerMainWindow_UIS_H}")
SET ( SCENEGL_SRCS
src/Camera.cc
src/Scene.cc
src/MeshVBO.cc
src/Shader.cc
src/Model.cc
src/MarkerData.cc
src/Animation.cc
src/ModelFitter.cc
src/Scripting.cc
)
SET ( QtGLBaseApp_SRCS
src/main.cc
src/GLWidget.cc
src/PuppeteerApp.cc
glew/src/glew.c
## CHART STUFF
src/vtkChart/chartXY.cc
)
QT5_WRAP_CPP ( QtGLBaseApp_MOC_SRCS
src/PuppeteerApp.h
src/PuppeteerAboutDialog.h
src/GLWidget.h
)
ADD_LIBRARY ( SceneGL STATIC
${SCENEGL_SRCS}
${PuppeteerMainWindow_UIS_H}
)
ADD_LIBRARY ( glew STATIC
glew/src/glew.c
)
ADD_EXECUTABLE ( puppeteer
${QtGLBaseApp_SRCS}
${QtGLBaseApp_MOC_SRCS}
${PuppeteerMainWindow_UIS_H}
)
ADD_EXECUTABLE ( fit_motion
src/fit_motion.cc
)
INCLUDE_DIRECTORIES (
${QT_INCLUDE_DIR}
glew/include
)
SET ( BUILD_SOURCE_DIRECTORY ${CMAKE_SOURCE_DIR} )
SET ( BUILD_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX} )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_BINARY_DIR}/src/config.h )
INCLUDE_DIRECTORIES (
${QT_INCLUDE_DIR}
glew/include
${QT_INCLUDE_DIR}/QtOpenGL
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/QtPropertyBrowser/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/c3dfile/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/luatables
${CMAKE_CURRENT_SOURCE_DIR}/vendor/tclap/include
${CMAKE_BINARY_DIR}/src
${RBDL_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
)
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
LINKER_LANGUAGE CXX
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
)
SUBDIRS (
tests
vendor/QtPropertyBrowser
vendor/c3dfile
vendor/luatables
)
TARGET_LINK_LIBRARIES ( SceneGL
glew
luatables
${LUA_LIBRARY}
${OPENGL_LIBRARIES}
${RBDL_LIBRARY}
${RBDL_LuaModel_LIBRARY}
${Qt5Widgets_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5OpenGL_LIBRARIES}
c3dfile
)
if(VTK_LIBRARIES)
if(${VTK_VERSION} VERSION_LESS "6")
target_link_libraries(puppeteer
SceneGL
${QT_LIBRARIES}
QtPropertyBrowser
${OPENGL_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${VTK_LIBRARIES}
QVTK
)
else()
target_link_libraries(puppeteer
SceneGL
${QT_LIBRARIES}
QtPropertyBrowser
${Boost_SYSTEM_LIBRARY}
${VTK_LIBRARIES}
)
endif()
else()
target_link_libraries(
puppeteer
SceneGL
${QT_LIBRARIES}
QtPropertyBrowser
${Boost_SYSTEM_LIBRARY}
vtkHybrid
QVTK
vtkViews
)
endif()
TARGET_LINK_LIBRARIES ( fit_motion
SceneGL
-lpthread # fix_nvidia_linking_new_ubuntu
)
# Installation
INSTALL (TARGETS puppeteer fit_motion
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
# Packaging
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_SECTION "science")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martin Felis <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5opengl5, libglu1-mesa (>=8.0), rbdl (> 2:2.2)")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Puppeteer - Motion Capture Mapping Tool")
SET(CPACK_PACKAGE_VENDOR "Martin Felis")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_VERSION_MAJOR ${MESHUP_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${MESHUP_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${MESHUP_VERSION_PATCH})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CPACK_PACKAGE ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
SET(CPACK_PACKAGE_FILE_NAME "MeshUp-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
IF(UNIX)
SET(CPACK_STRIP_FILES "bin/puppeteer")
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "puppeteer;Puppeteer")
INCLUDE(CPack)