forked from openglsuperbible/sb6code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·143 lines (128 loc) · 3.03 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
cmake_minimum_required (VERSION 2.6)
project (SuperBible6)
LINK_DIRECTORIES( ${CMAKE_SOURCE_DIR}/lib )
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(WIN32)
set(COMMON_LIBS sb6 optimized GLFW_r32 debug GLFW_d32)
elif (UNIX)
set(COMMON_LIBS sb6 glfw ${GLFW_LIBRARIES} GL rt dl)
else()
set(COMMON_LIBS sb6)
endif()
IF(APPLE)
INCLUDE_DIRECTORIES(/System/Library/Frameworks)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
FIND_LIBRARY(OpenGL_LIBRARY OpenGL)
FIND_LIBRARY(IOKit_LIBRARY IOKit)
MARK_AS_ADVANCED(COCOA_LIBRARY OpenGL_LIBRARY)
SET(EXTRA_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY})
SET(EXTRA_LIBS ${EXTRA_LIBS} /usr/local/lib/libglfw.a)
ENDIF(APPLE)
set(COMMON_LIBS ${COMMON_LIBS} ${EXTRA_LIBS})
add_library(sb6
src/sb6/sb6.cpp
src/sb6/sb6ktx.cpp
src/sb6/sb6object.cpp
src/sb6/sb6shader.cpp
src/sb6/gl3w.c
)
set(RUN_DIR ${PROJECT_SOURCE_DIR}/bin)
set(EXAMPLES
alienrain
basicfbo
blendmatrix
blinnphong
bumpmapping
clipdistance
csflocking
cubemapenv
cubicbezier
deferredshading
depthclamp
dispmap
dof
envmapsphere
equirectangular
fragcolorfrompos
fragmentlist
grass
gsculling
gslayered
gsquads
gstessellate
hdrbloom
hdrexposure
hdrtonemap
indexedcube
instancedattribs
julia
ktxview
linesmooth
movingtri
msaanative
multidrawindirect
multimaterial
multiscissor
multiviewport
noise
noperspective
normalviewer
objectexploder
perf-readpixels
perpixelgloss
phonglighting
polygonsmooth
prefixsum
prefixsum2d
programinfo
raytracer
rimlight
sampleshading
# sb6mrender
shadowmapping
shapedpoints
simpleclear
simpletexcoords
simpletexture
singlepoint
singletri
sparsetexture
spinnycube
springmass
ssao
starfield
stereo
subroutines
tessellatedcube
tessellatedgstri
tessellatedtri
tessmodes
tesssubdivmodes
toonshading
tunnel
wrapmodes
)
if (WIN32)
set(EXAMPLES ${EXAMPLES} win32raw)
endif()
#if(UNIX)
# add_executable(xraw src/xraw/xraw.c)
# target_link_libraries(xraw GL X11 m)
#endif(UNIX)
foreach(EXAMPLE ${EXAMPLES})
add_executable(${EXAMPLE} WIN32 src/${EXAMPLE}/${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} ${COMMON_LIBS})
if(MSVC)
configure_file(${PROJECT_SOURCE_DIR}/build/vs2010/VisualStudioUserFile.vcproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.vcproj.user @ONLY)
configure_file(${PROJECT_SOURCE_DIR}/build/vs2010/VisualStudioUserFile.vcxproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.vcxproj.user @ONLY)
endif(MSVC)
endforeach(EXAMPLE)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LINUX")
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include_directories( include )
include_directories( extern/glfw-2.7.6/include )
ADD_CUSTOM_TARGET(debug ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=Debug ${PROJECT_SOURCE_DIR})
ADD_CUSTOM_TARGET(release ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=Release ${PROJECT_SOURCE_DIR})