-
Notifications
You must be signed in to change notification settings - Fork 47
/
CMakeLists.txt
70 lines (59 loc) · 2.1 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(FORGE)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
INCLUDE(FGInstallDirs)
OPTION(BUILD_DOCUMENTATION "Build Documentation" OFF)
OPTION(BUILD_EXAMPLES "Build Examples" OFF)
OPTION(USE_SYSTEM_GLM "Use system GLM" OFF)
OPTION(USE_SYSTEM_FREETYPE "Use system freetype" OFF)
# Set a default build type if none was specified
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
ENDIF()
IF(UNIX)
ADD_DEFINITIONS(-Wall -std=c++11 -fvisibility=hidden)
ENDIF()
# OS Definitions
IF(UNIX)
IF(APPLE)
ADD_DEFINITIONS(-DOS_MAC)
SET(CMAKE_MACOSX_RPATH ON)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
ENDIF("${isSystemDir}" STREQUAL "-1")
ELSE(APPLE)
ADD_DEFINITIONS(-DOS_LNX)
ENDIF(APPLE)
ELSE(UNIX)
ADD_DEFINITIONS(-DOS_WIN -DNOMINMAX)
ENDIF(UNIX)
# Architechture Definitions
#INCLUDE(${CMAKE_MODULE_PATH}/TargetArch.cmake)
#target_architecture(ARCH)
#IF(${ARCH} STREQUAL "x86_64")
# ADD_DEFINITIONS(-DARCH_64)
#ELSE(${ARCH})
# ADD_DEFINITIONS(-DARCH_32)
#ENDIF()
INCLUDE(${CMAKE_MODULE_PATH}/Version.cmake)
ADD_SUBDIRECTORY(src)
## Install step
INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION "${FG_INSTALL_INC_DIR}"
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp"
PATTERN ".gitignore" EXCLUDE
)
# Generate documentation using cldoc
IF(BUILD_DOCUMENTATION)
ADD_SUBDIRECTORY(docs)
ENDIF(BUILD_DOCUMENTATION)