-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
266 lines (205 loc) · 8.2 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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_policy(VERSION 2.8)
project(JellyFish)
cmake_policy(SET CMP0020 NEW)
enable_testing()
#CMAKE_BUILD_TOOL
if(CMAKE_CURRENT_SOURCE_DIR EQUAL CMAKE_CURRENT_BINARY_DIR)
message(FATAL_ERROR "Source and binary directories must be different")
endif(CMAKE_CURRENT_SOURCE_DIR EQUAL CMAKE_CURRENT_BINARY_DIR)
set (CMAKE_PREFIX_PATH "C:\\Qt\\Qt5.2.0\\5.2.0-beta1\\msvc2012_64_opengl"
"C:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x64"
)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
################################
# Add GLEXT
#function(getKhronosGLHeader HEADER)
# file(DOWNLOAD http://www.opengl.org/registry/api/GL/${HEADER}
# khronos-headers/GL/${HEADER})
#endfunction(getKhronosGLHeader)
#download Updated OpenGL Extension headers.
#getKhronosGLHeader(glext.h)
#getKhronosGLHeader(glcorearb.h)
#getKhronosGLHeader(glxext.h)
#getKhronosGLHeader(wglext.h)
#include_directories(${CMAKE_CURRENT_BINARY_DIR}/khronos-headers/)
################################
# Add GLEW
#set(GLEW_DIRECTORY glew-1.10.0)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLEW_DIRECTORY}/include)
#add_definitions(-DGLEW_STATIC)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLEW_DIRECTORY}/include)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLEW_DIRECTORY})
################################
# Add GLFW
#set(GLFW_DIRECTORY glfw-3.0.3)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLFW_DIRECTORY}/include)
#set(GLFW_INSTALL OFF CACHE STRING "" FORCE)
#set(GLFW_BUILD_EXAMPLES OFF CACHE STRING "" FORCE)
#set(GLFW_BUILD_TESTS OFF CACHE STRING "" FORCE)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLFW_DIRECTORY})
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLFW_DIRECTORY}/include)
################################
# Add GLM
#set(GLM_DIRECTORY glm-0.9.5.B)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLM_DIRECTORY})
################################
# Add GLI
#set(GLI_DIRECTORY gli-0.4.1.0)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLI_DIRECTORY})
################################
# Add GLO
#set(GLO_DIRECTORY glo-0.1.0.0)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${GLO_DIRECTORY})
################################
# Add GLF
#set(GLF_DIRECTORY glf)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/)
################################
# # Add OpenGL ES
# set(ES_DIRECTORY gles-2.0)
# if(MSVC AND NOT CMAKE_CL_64)
# set(ES_BINARY_DIRECTORY "win32-vc")
# endif(MSVC AND NOT CMAKE_CL_64)
# if(MSVC AND CMAKE_CL_64)
# set(ES_BINARY_DIRECTORY "win64-vc")
# endif(MSVC AND CMAKE_CL_64)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${ES_DIRECTORY})
# if(WIN32)
# link_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${ES_DIRECTORY}/lib/${ES_BINARY_DIRECTORY})
# endif()
# set(ES_LIBRARY libGLESv2)
# ################################
# # Add EGL
# set(EGL_DIRECTORY egl-1.4)
# if(MSVC AND NOT CMAKE_CL_64)
# set(EGL_BINARY_DIRECTORY "win32-vc")
# endif(MSVC AND NOT CMAKE_CL_64)
# if(MSVC AND CMAKE_CL_64)
# set(EGL_BINARY_DIRECTORY "win64-vc")
# endif(MSVC AND CMAKE_CL_64)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${EGL_DIRECTORY})
# if(WIN32)
# link_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/${EGL_DIRECTORY}/lib/${EGL_BINARY_DIRECTORY})
# endif()
# set(EGL_LIBRARY libEGL)
# ################################
# # Add libraries to executables
# set(BINARY_FILES GLEW glfw ${GLFW_LIBRARIES})
# ################################
# # Add output directory
if(MSVC)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/build/)
else(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/build/debug )
else(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/build/release )
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
endif(MSVC)
################################
# Add custom target to copy all data
#if(APPLE)
# add_custom_target(
# ${TARGET_DATA_COPY}
# COMMAND ls)
#else(APPLE)
# set(TARGET_DATA_COPY DATA_COPY)
# if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
# add_custom_target(
# ${TARGET_DATA_COPY}
# COMMAND ${CMAKE_COMMAND} -E echo "In source build")
# else(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
# add_custom_target(
# ${TARGET_DATA_COPY}
# COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data)
# endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
#endif(APPLE)
#set(OGL_DATA_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data)
################################
# Add options
#option(OGL_SAMPLES_STATUS "OGL_SAMPLES_STATUS" OFF)
#if(OGL_SAMPLES_STATUS)
# add_definitions(-DGLF_AUTO_STATUS)
#endif()
#if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
# if (NOT APPLE)
# add_definitions(-fpermissive)
# endif()
#endif()
################################
# Add definitions
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
################################
# function to create a project for the sample in the solution
# function(createSample NAME)
# file(GLOB PROJECT_SOURCE *.cpp)
# file(GLOB_RECURSE PROJECT_SHADER *.vert *.frag *.geom *.cont *.eval *.glsl *.vs *.fs *.gs *.ps *.es)
# file(GLOB PROJECT_INLINE *.inl)
# file(GLOB PROJECT_HEADER *.hpp)
# file(GLOB PROJECT_TEXT readme.txt)
# source_group("Text Files" FILES ${PROJECT_TEXT})
# source_group("Inline Files" FILES ${PROJECT_INLINE})
# source_group("Shader Files" FILES ${PROJECT_SHADER})
# add_executable(${NAME} ${PROJECT_SOURCE} ${PROJECT_INLINE} ${PROJECT_HEADER} ${PROJECT_SHADER} ${PROJECT_TEXT})
# add_custom_command(
# TARGET ${NAME} POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data)
# add_custom_command(
# TARGET ${NAME} POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_BINARY} ${CMAKE_CURRENT_BINARY_DIR})
# add_dependencies(${NAME} glfw GLEW)
# target_link_libraries(${NAME} ${BINARY_FILES})
# install ( TARGETS ${NAME} DESTINATION .)
# endfunction(createSample)
# function(createSampleWGL NAME)
# file(GLOB PROJECT_SOURCE *.cpp)
# file(GLOB_RECURSE PROJECT_SHADER *.vert *.frag *.geom *.cont *.eval *.glsl)
# file(GLOB PROJECT_INLINE *.inl)
# file(GLOB PROJECT_HEADER *.hpp)
# file(GLOB PROJECT_TEXT readme.txt)
# source_group("Text Files" FILES ${PROJECT_TEXT})
# source_group("Inline Files" FILES ${PROJECT_INLINE})
# source_group("Shader Files" FILES ${PROJECT_SHADER})
# add_executable(${NAME} WIN32 ${PROJECT_SOURCE} ${PROJECT_INLINE} ${PROJECT_HEADER} ${PROJECT_SHADER} ${PROJECT_TEXT})
# add_custom_command(
# TARGET ${NAME} POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data)
# add_custom_command(
# TARGET ${NAME} POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_BINARY} ${CMAKE_CURRENT_BINARY_DIR})
# add_dependencies(${NAME} GLEW glfw)
# target_link_libraries(${NAME} ${BINARY_FILES})
# install ( TARGETS ${NAME} DESTINATION .)
# endfunction(createSampleWGL)
################################
# Add subdirectory
#add_subdirectory(practices)
add_subdirectory(qpractices)
install (
DIRECTORY data
DESTINATION .
)
# See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
set (CPACK_PACKAGE_VERSION_MAJOR "0")
set (CPACK_PACKAGE_VERSION_MINOR "0")
set (CPACK_PACKAGE_VERSION_PATCH "1")
# Use current date in YYYYMMDD format as patch number
# cpack mistakenly detects Mingw-w64 as win32
#if (MINGW)
# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
# set (CPACK_SYSTEM_NAME win64)
# endif ()
#endif ()
#if (WIN32)
# set (CPACK_GENERATOR "ZIP")
#else ()
# set (CPACK_GENERATOR "TBZ2")
#endif ()
include(CPack)