-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
160 lines (119 loc) · 4.32 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
cmake_minimum_required(VERSION 2.6)
PROJECT(bdmorph)
FIND_PACKAGE(Qt4 REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
###################################################################################################
if (WIN32)
SET(ROOT C:/Users/mlevtsky/Workspace/external)
SET (EXTERNAL_LIBRARIES
${ROOT}/lib/libamd.lib
${ROOT}/lib/libcamd.lib
${ROOT}/lib/libcolamd.lib
${ROOT}/lib/libccolamd.lib
${ROOT}/lib/libcholmod.lib
${ROOT}/lib/libgoto_CHOLMOD.lib
${ROOT}/lib/libmetis_CHOLMOD.lib
${ROOT}/lib/avcodec.lib
${ROOT}/lib/avformat.lib
${ROOT}/lib/avutil.lib
${ROOT}/lib/swscale.lib
)
SET(EXTERNAL_INCLUDES
${ROOT}/include/
${ROOT}/include/suitesparse/
)
SET(ICON_RC_FILE GUI/icon/winicon.rc)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX -D_USE_MATH_DEFINES ")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX -D_USE_MATH_DEFINES ")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:NOREF" )
endif(WIN32)
###################################################################################################
if (APPLE)
SET (EXTERNAL_LIBRARIES
cholmod amd camd colamd suitesparseconfig
blas lapack
avcodec avformat avutil swscale swresample
"-framework CoreFoundation"
"-framework CoreVideo"
"-framework VideoDecodeAcceleration"
x264 z bz2 iconv
)
SET (EXTERNAL_INCLUDES
/usr/local/include/suitesparse
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-reorder")
set(MACOSX_BUNDLE_ICON_FILE macicon.icns)
set(bdmorph_ICON ${CMAKE_CURRENT_SOURCE_DIR}/GUI/icon/macicon.icns)
set_source_files_properties(${bdmorph_ICON} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
SET(ICON_RC_FILE ${bdmorph_ICON})
endif(APPLE)
###################################################################################################
if (NOT APPLE AND UNIX) # <- this is the way it should be
SET (EXTERNAL_LIBRARIES
cholmod amd camd colamd
openblas lapack
avcodec avformat avutil swscale
)
SET (EXTERNAL_INCLUDES
/usr/include/suitesparse
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-reorder -Woverloaded-virtual")
endif(NOT APPLE AND UNIX)
###################################################################################################
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${EXTERNAL_INCLUDES}
. ./GUI ./core ./utils ./GUI/widgets
)
SET(bdmorph_SOURCES
GUI/EditorWindow.cpp GUI/Main.cpp GUI/MainWindow.cpp
GUI/SidePanel.cpp GUI/AnimationPanel.cpp GUI/OffScreenRenderer.cpp
GUI/widgets/ActionButton.cpp GUI/ProgramState.cpp
core/MeshModel.cpp core/KVFModel.cpp core/VideoModel.cpp
core/BDMORPH.cpp core/OutlineModel.cpp
utils/cholmod_matrix.cpp utils/cholmod_common.cpp utils/vector2d.cpp
utils/triangle.c utils/utils.cpp utils/ffmpeg_encoder.cpp
)
SET(bdmorph_HEADERS_QT
GUI/EditorWindow.h GUI/MainWindow.h GUI/SidePanel.h
GUI/AnimationPanel.h GUI/OffScreenRenderer.h GUI/widgets/ActionButton.h
GUI/ProgramState.h
)
SET(bdmorph_HEADERS
${bdmorph_HEADERS_QT}
core/MeshModel.h core/KVFModel.h core/VideoModel.h
core/BDMORPH.h core/OutlineModel.h
utils/cholmod_matrix.h utils/cholmod_common.h utils/vector2d.h
utils/triangle.h utils/utils.h
utils/ffmpeg_encoder.h
)
SET(bdmorph_FORMS
GUI/MainWindow.ui GUI/SidePanel.ui GUI/AnimationPanel.ui GUI/About.ui
)
SET(bdmorph_RESOURCES GUI/resources/resources.rc )
###################################################################################################
QT4_WRAP_CPP(bdmorph_HEADERS_MOC ${bdmorph_HEADERS_QT})
QT4_WRAP_UI(bdmorph_FORMS_HEADERS ${bdmorph_FORMS})
QT4_ADD_RESOURCES(bdmorph_RESOURCES_RCC ${bdmorph_RESOURCES})
ADD_EXECUTABLE(bdmorph WIN32 MACOSX_BUNDLE
${bdmorph_SOURCES}
${bdmorph_RESOURCES_RCC}
${bdmorph_HEADERS_MOC}
${bdmorph_FORMS_HEADERS}
${bdmorph_HEADERS}
${ICON_RC_FILE}
)
TARGET_LINK_LIBRARIES(bdmorph
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${EXTERNAL_LIBRARIES}
)
###################################################################################################