-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
69 lines (57 loc) · 1.75 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_POLICY(
SET CMP0048 NEW
)
CMAKE_POLICY(
SET CMP0058 NEW
)
CMAKE_POLICY(
SET CMP0072 NEW
)
PROJECT (freetype-direct-gl
VERSION 1.0.0
LANGUAGES C CXX
)
INCLUDE(ExternalProject)
IF(APPLE)
SET(CMAKE_MACOSX_RPATH 1)
SET(CMAKE_PREFIX_PATH /usr/local)
SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
ENDIF()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG")
#SET(CMAKE_BUILD_TYPE "RELEASE")
#SET(CMAKE_BUILD_TYPE "RELWITHDEBINFO")
#SET(CMAKE_BUILD_TYPE "MINSIZEREL")
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(warnings "-Wall -Wextra -Werror")
set(no_undefined "-Wl,--no-undefined")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror -Wno-inconsistent-missing-override")
set(no_undefined "-Wl,-undefined,error")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(warnings "/W4 /WX /EHsc")
set(no_undefined "")
endif()
SET(CXX_STANDARD_REQUIRED OFF)
SET(CXX_EXTENSION NO)
if (NOT CONFIGURED_ONCE)
set(CMAKE_C_FLAGS "-g -O0 -fPIC ${warnings}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
set(CMAKE_CXX_FLAGS "-g -O0 -fPIC ${warnings} -std=c++14"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
set(CMAKE_LINK_FLAGS "${no_undefined}"
CACHE STRING "Flags used by the linker during all build types." FORCE)
endif()
FIND_PACKAGE(FontConfig REQUIRED)
IF(NOT APPLE)
FIND_PACKAGE(GLEW REQUIRED)
ENDIF()
FIND_PACKAGE(GLM REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(Freetype REQUIRED)
FIND_PACKAGE(Boost 1.62 REQUIRED)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)