-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
177 lines (149 loc) · 4.52 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
PROJECT ( MESHUP )
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)
SET (MESHUP_VERSION_MAJOR 0)
SET (MESHUP_VERSION_MINOR 6)
SET (MESHUP_VERSION_PATCH 0)
SET (MESHUP_VERSION_STRING "${MESHUP_VERSION_MAJOR}.${MESHUP_VERSION_MINOR}.${MESHUP_VERSION_PATCH}")
SET (MESHUP_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# Get VCS information
#EXECUTE_PROCESS (COMMAND "hg" "id" "-i"
# OUTPUT_VARIABLE VCS_ID
# RESULT_VARIABLE VCS_RESULT
# )
#IF (NOT VCS_RESULT)
STRING(REGEX REPLACE "(\r?\n)+$" "" VCS_ID "${VCS_ID}")
SET (MESHUP_VERSION_STRING "${MESHUP_VERSION_STRING} (${VCS_ID})")
#ENDIF (NOT VCS_RESULT)
# The QT Interface
SET( QT_USE_QTXML TRUE )
SET( QT_USE_QTOPENGL TRUE )
SET( QT_WRAP_CPP TRUE )
FIND_PACKAGE (Qt5Widgets REQUIRED)
FIND_PACKAGE (Qt5OpenGL)
FIND_PACKAGE (OpenGL)
FIND_PACKAGE (Boost COMPONENTS filesystem system REQUIRED)
INCLUDE_DIRECTORIES (
vendor/glew/include
vendor/lua-5.1/src/
vendor/QTFFmpegWrapper/src/
src/luatables
${CMAKE_CURRENT_BINARY_DIR}/src/
)
SUBDIRS (
tests/
vendor/jsoncpp/
vendor/lua-5.1/
vendor/QTFFmpegWrapper/
)
ADD_LIBRARY ( glew
vendor/glew/src/glew.c
vendor/glew/src/glewinfo.c
vendor/glew/src/visualinfo.c
)
ADD_DEFINITIONS (${QT_DEFINITIONS})
ADD_DEFINITIONS (${FFMPEG_DEFINITIONS})
SET ( MainWindow_UIS
ui/MainWindow.ui
ui/RenderImageDialog.ui
ui/RenderImageSeriesDialog.ui
ui/RenderVideoDialog.ui
)
QT5_WRAP_UI (MainWindow_UIS_H ${MainWindow_UIS})
SET ( MeshupApp_SRCS
src/main.cc
src/glwidget.cc
src/MeshupApp.cc
)
QT5_WRAP_CPP ( MeshupApp_MOC_SRCS
src/MeshupApp.h
src/RenderImageDialog.h
src/RenderImageSeriesDialog.h
src/RenderVideoDialog.h
src/glwidget.h
)
ADD_EXECUTABLE ( meshup
src/Model.cc
src/Animation.cc
src/MeshVBO.cc
src/Curve.cc
src/ForcesTorques.cc
src/Scene.cc
src/Camera.cc
src/CameraOperator.cc
src/Scripting.cc
src/Arrow.cc
src/luatables/luatables.cc
${MeshupApp_SRCS}
${MeshupApp_MOC_SRCS}
${MainWindow_UIS_H}
)
INCLUDE_DIRECTORIES (${QT_INCLUDE_DIR})
INCLUDE_DIRECTORIES (${QT_INCLUDE_DIR}/QtOpenGL)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES ( include )
INCLUDE_DIRECTORIES ( vendor/jsoncpp/include )
INCLUDE_DIRECTORIES ( vendor/QTFFmpegWrapper/src )
INCLUDE_DIRECTORIES (${FFMPEG_INCLUDE_DIRS})
CONFIGURE_FILE (
"${CMAKE_CURRENT_SOURCE_DIR}/src/meshup_config.h.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/src/meshup_config.h"
)
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
LINKER_LANGUAGE CXX
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
)
#qt5_use_modules(meshup Widgets Core OpenGL)
TARGET_LINK_LIBRARIES ( meshup
${Qt5Widgets_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5OpenGL_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${Boost_LIBRARIES}
lua-static
glew
json
qtffmpeg
)
# Installation
INSTALL (TARGETS meshup
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
FILE ( GLOB model_files
models/*.lua
)
FILE ( GLOB mesh_files
meshes/*.obj
)
INSTALL ( FILES ${model_files} DESTINATION share/meshup/models )
INSTALL ( FILES ${mesh_files} DESTINATION share/meshup/meshes )
# 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), libboost-filesystem1.48.0 (>= 1.48.0-1)")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MeshUp - a visualization tool for multi-body systems based on skeletal animation and magic.")
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/meshup")
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "meshup;Meshup")
INCLUDE(CPack)