forked from ddiproietto/nontetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (70 loc) · 2.43 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
#*****************************************************************************
#
# Copyright (C) 2013 Daniele Di Proietto <[email protected]>
#
# This file is part of nontetris.
#
# nontetris is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nontetris is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nontetris. If not, see <http://www.gnu.org/licenses/>.
#
#*****************************************************************************
if(DEFINED CHEERP)
cmake_minimum_required (VERSION 2.6) #Decent version
else(DEFINED CHEERP)
if(NOT DEFINED EMSCRIPTEN)
cmake_minimum_required (VERSION 2.8) #For file( COPY)
else(NOT DEFINED EMSCRIPTEN)
cmake_minimum_required (VERSION 2.8.8) #For object libraries
endif(NOT DEFINED EMSCRIPTEN)
endif(DEFINED CHEERP)
project (Nontetris)
set (NONTETRIS_VERSION_MAJOR 0)
set (NONTETRIS_VERSION_MINOR 1)
option(USE_GLFW_3 "Use glfw3(otherwise use glfw2)" OFF)
if(USE_GLFW_3)
set(USE_GLFW_VERSION 3)
else(USE_GLFW_3)
set(USE_GLFW_VERSION 2)
endif(USE_GLFW_3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
IF(DEFINED CHEERP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
ENDIF(DEFINED CHEERP)
IF(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows")
ENDIF(MINGW)
if(NOT DEFINED CHEERP)
if(NOT DEFINED EMSCRIPTEN)
##OpenGL##
find_package(OpenGL REQUIRED)
##END OpenGL##
find_package(PkgConfig REQUIRED)
##GLFW##
if(USE_GLFW_3)
pkg_search_module(GLFW REQUIRED glfw3)
else(USE_GLFW_3)
pkg_search_module(GLFW REQUIRED libglfw)
endif(USE_GLFW_3)
##END GLFW##
##GLEW##
pkg_search_module(GLEW REQUIRED glew)
##END GLEW##
endif(NOT DEFINED EMSCRIPTEN)
file(COPY src/shader.frag DESTINATION ${PROJECT_BINARY_DIR})
file(COPY src/shader.vert DESTINATION ${PROJECT_BINARY_DIR})
file(COPY src/shadercomp.frag DESTINATION ${PROJECT_BINARY_DIR})
file(COPY imgs/pieces DESTINATION ${PROJECT_BINARY_DIR}/imgs)
file(COPY imgs DESTINATION ${PROJECT_BINARY_DIR})
endif(NOT DEFINED CHEERP)
add_subdirectory(srclib)
add_subdirectory(src)