-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
140 lines (97 loc) · 3.27 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
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_policy(VERSION 2.6)
##########################
# Macros
macro(add_group_target_GTC Target)
add_custom_target(
${Target} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Group target..." )
endmacro(add_group_target_GTC)
macro(add_parallel_build_GTC Count)
if(MSVC)
add_definitions(/MP${Count})
endif(MSVC)
endmacro(add_parallel_build_GTC)
##########################
# Project
project(kueken)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
if(NOT MSVC)
add_definitions(-std=gnu++0x)
endif(NOT MSVC)
##########################
# Setup binary directory
if(MSVC AND NOT CMAKE_CL_64)
set(BINARY_DIRECTORY "win32")
endif(MSVC AND NOT CMAKE_CL_64)
if(MSVC AND CMAKE_CL_64)
set(BINARY_DIRECTORY "win64")
endif(MSVC AND CMAKE_CL_64)
set(GLF_LIBRARY_BINARY_FILE_SDL "tinyxml")
set(GLF_LIBRARY_BINARY_FILE_OGL "opengl32" "glew32s" "freeglut_static")
set(GLF_LIBRARY_BINARY_FILE ${GLF_LIBRARY_BINARY_FILE_OGL})
############
# Boost
set(BOOST_VERSION "boost-1.43.0")
set(BOOST_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${BOOST_VERSION})
include_directories("${BOOST_DIRECTORY}")
link_directories("${BOOST_DIRECTORY}/binary/${BINARY_DIRECTORY}")
############
# TinyXML
set(TINYXML_VERSION "tinyxml-2.6.1")
set(TINYXML_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${TINYXML_VERSION})
include_directories("${TINYXML_DIRECTORY}/include")
link_directories("${TINYXML_DIRECTORY}/library/${BINARY_DIRECTORY}")
############
# Add GLUT
set(GLUT_VERSION "freeglut-2.6.0")
set(GLUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLUT_VERSION})
add_definitions(-DFREEGLUT_STATIC)
include_directories("${GLUT_DIRECTORY}")
link_directories("${GLUT_DIRECTORY}/lib/${BINARY_DIRECTORY}")
############
# Add GLEW
set(GLEW_VERSION "glew-1.10.0")
set(GLEW_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLEW_VERSION})
add_definitions(-DGLEW_STATIC)
include_directories(${GLEW_DIRECTORY}/include)
link_directories(${GLEW_DIRECTORY}/lib/${BINARY_DIRECTORY})
############
# Add GLEXT
set(GL_VERSION "GL")
set(GL_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GL_VERSION})
###########
# Add GLF
set(GLF_VERSION "glf")
set(GLF_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLF_VERSION})
include_directories("${GLF_DIRECTORY}")
###########
# Add GLM
set(GLM_VERSION "glm-0.9.5.B")
set(GLM_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLM_VERSION})
include_directories("${GLM_DIRECTORY}")
###########
# Add GLV
set(GLV_VERSION "glv-0.1.0.0")
set(GLV_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLV_VERSION})
include_directories("${GLV_DIRECTORY}")
###########
# Add GLI
set(GLI_VERSION "gli-0.4.1.0")
set(GLI_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/${GLI_VERSION})
include_directories("${GLI_DIRECTORY}")
################################
# Add custom target to copy all data
set(KUEKEN_TEST_DATA DATA_COPY)
add_custom_target(
${KUEKEN_TEST_DATA}
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test/data ${CMAKE_CURRENT_BINARY_DIR}/test/data)
###########
set(KUEKEN_CORE_NAME kueken-core)
set(KUEKEN_LOAD_NAME kueken-load)
set(KUEKEN_IO_NAME kueken-io)
set(KUEKEN_FX_NAME kueken-fx)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
add_subdirectory(source)
add_subdirectory(test)