forked from sysexits/CS380
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
129 lines (102 loc) · 3.16 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
cmake_minimum_required (VERSION 2.6)
cmake_policy(SET CMP0026 OLD)
project (CS380)
find_package(OpenGL REQUIRED)
if( CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR )
message( FATAL_ERROR "Please select another Build Directory" )
endif()
if( CMAKE_SOURCE_DIR MATCHES " " )
message( "Your Source Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()
if( CMAKE_BINARY_DIR MATCHES " " )
message( "Your Build Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()
# Compile external dependencies
add_subdirectory (ExternalProjects)
# On Visual 2005 and above, this module can set the debug working directory
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/ExternalProjects/cmake-modules-master")
include(CreateLaunchers)
include(MSVCMultipleProcessCompile) # /MP
if(INCLUDE_DISTRIB)
add_subdirectory(distrib)
endif(INCLUDE_DISTRIB)
include_directories(
ExternalProjects/glfw-3.0.3/include/GLFW/
ExternalProjects/glm-0.9.4.0/
ExternalProjects/glew-1.9.0/include/
.
)
set(ALL_LIBS
${OPENGL_LIBRARY}
GLFW_303
GLEW_190
)
add_definitions(
-DTW_STATIC
-DTW_NO_LIB_PRAGMA
-DTW_NO_DIRECT3D
-DGLEW_STATIC
-D_CRT_SECURE_NO_WARNINGS
)
# Skeleton Project
add_executable(SkeletonProject
Skeleton/main.cpp
common/shader.cpp
common/shader.hpp
Skeleton/TransformVertexShader.glsl
Skeleton/ColorFragmentShader.glsl
)
target_link_libraries(SkeletonProject
${ALL_LIBS}
)
# Xcode and Visual Studio working directories
set_target_properties(SkeletonProject PROPERTIES XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Skeleton/")
create_target_launcher(SkeletonProject WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Skeleton/")
# Lab1 session 1
add_executable(Lab1
Lab1/main.cpp
common/shader.cpp
common/shader.hpp
Lab1/VertexShader.glsl
Lab1/FragmentShader.glsl
)
target_link_libraries(Lab1
${ALL_LIBS}
)
# Xcode and Visual Studio working directories
set_target_properties(Lab1 PROPERTIES XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Lab1/")
create_target_launcher(Lab1 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Lab1/")
# Lab session 2
add_executable(Lab2
Lab2/main.cpp
common/shader.cpp
common/shader.hpp
common/model.cpp
common/model.hpp
Lab2/VertexShader.glsl
Lab2/FragmentShader.glsl
)
target_link_libraries(Lab2
${ALL_LIBS}
)
# Xcode and Visual Studio working directories
set_target_properties(Lab2 PROPERTIES XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Lab2/")
create_target_launcher(Lab2 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Lab2/")
# Homework 1
add_executable(Homework1
Homework1/main.cpp
common/shader.cpp
common/shader.hpp
Homework1/VertexShader.glsl
Homework1/FragmentShader.glsl
)
target_link_libraries(Homework1
${ALL_LIBS}
)
# Xcode and Visual Studio working directories
set_target_properties(Homework1 PROPERTIES XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Homework1/")
create_target_launcher(Homework1 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Homework1/")