-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
75 lines (52 loc) · 1.61 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
cmake_minimum_required (VERSION 3.12)
project ("Voxplat")
set( VERSION_MAJOR 0 )
set( VERSION_MINOR 11 )
### PLATFORM DETECTION ###
if(APPLE)
message( FATAL_ERROR "APPLE is not supported" )
endif()
if(WIN32)
if(NOT MINGW)
message( FATAL_ERROR "Only MinGW is supported on Windows! Use cmake .. -G \"MinGW Makefiles\"")
endif()
endif()
### CONFIGURATION ###
# Disable building useless GLFW stuff
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
# Export stuff for linters
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# 3rd party library location
set( EXTERNAL ext )
# DEBUG
set( DEBUG_GFX_TEXT_WRITE_PPM 0 )
configure_file(config.h.in ${PROJECT_SOURCE_DIR}/include/config.h)
### CLI OPTIONS ###
option( DEBUG "Compile in debugging mode" )
#if(DEBUG)
# set( CMAKE_BUILD_TYPE Debug )
# set( CMAKE_BUILD_TYPE RelWithDebInfo )
#endif(DEBUG)
### LIBRARIES ###
# GLFW
add_subdirectory (${EXTERNAL}/glfw)
include_directories (${EXTERNAL}/glfw/include) # windows wants this
# Freetype
add_subdirectory (${EXTERNAL}/freetype)
include_directories (${EXTERNAL}/freetype/include)
# CGLM (header-only)
include_directories (${EXTERNAL}/cglm/include)
# stb/stb_image.h (header-only)
# Initalized in gfx
include_directories (${EXTERNAL}/stb)
# OPENMP
find_package(OpenMP REQUIRED)
# In case linters still complain:
# include_directories(/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/include/)
# "find /usr -name omp.h"
include_directories (include)
include_directories (src)
### BUILD ###
add_subdirectory(src)