-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
94 lines (80 loc) · 2.94 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
# This file is part of imaginaryMyst.
#
# imaginaryMyst 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.
#
# imaginaryMyst 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 imaginaryMyst. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.1)
project(imaginaryMyst LANGUAGES CXX)
include(FeatureSummary)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(ENABLE_SSE2 "Build with SSE2 SIMD instructions" ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(CMAKE_CXX_FLAGS "-Wno-unused-parameter -Werror ${CMAKE_CXX_FLAGS}")
if(ENABLE_SSE2)
set(CMAKE_CXX_FLAGS "-msse2 ${CMAKE_CXX_FLAGS}")
endif()
endif()
find_package(OpenGL REQUIRED)
set_package_properties(OpenGL PROPERTIES
DESCRIPTION "libGL and libGLU libraries"
TYPE REQUIRED
)
find_package(SDL2 REQUIRED)
set_package_properties(SDL2 PROPERTIES
URL "https://www.libsdl.org"
DESCRIPTION "Simple DirectMedia Layer"
TYPE REQUIRED
)
if(SDL2_FOUND AND TARGET SDL2::SDL2)
# The CMake-style export target automatically configures include
# directories, linker flags, etc for us
set(SDL2_LIBRARIES SDL2::SDL2 SDL2::SDL2main)
else()
# The autotools-generated cmake file may contain trailing whitespace,
# which is treated as an error in CMake with CMP0004
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
endif()
find_package(GLM REQUIRED)
set_package_properties(GLM PROPERTIES
URL "https://glm.g-truc.net/"
DESCRIPTION "OpenGL Mathematics library"
TYPE REQUIRED
)
find_package(ZLIB REQUIRED)
set_package_properties(ZLIB PROPERTIES
URL "http://www.zlib.net"
DESCRIPTION "Fast (de)compression library"
TYPE REQUIRED
)
find_package(string_theory 2.0 REQUIRED)
set_package_properties(string_theory PROPERTIES
URL "http://github.com/zrax/string_theory"
DESCRIPTION "Flexible C++11 string library and type-safe formatter"
TYPE REQUIRED
)
include_directories(${STRING_THEORY_INCLUDE_DIRS})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
include_directories(${GLEW_INCLUDE_DIR})
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLM_INCLUDE_DIRS})
if(SDL2_INCLUDE_DIRS)
include_directories(${SDL2_INCLUDE_DIRS})
endif()
include_directories(${ZLIB_INCLUDE_DIR})
# 3rd party Squish library for DXT codecs
include_directories(libsquish)
add_subdirectory(libsquish)
# The imaginaryMyst application
add_subdirectory(src)