-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (61 loc) · 2.08 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
# CMake Version
cmake_minimum_required(VERSION 2.8)
# Project Name
project(GameWrapper)
set(OutputName "GameWrapper.app")
# Build Directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/Build)
# Apple Boost
if (APPLE)
link_directories(/usr/local/include)
include_directories(/usr/local/include)
endif()
# CMake Flags
if (WIN32)
# C++11
else()
if (APPLE)
# C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 --stdlib=libc++ -m64")
set(EXTRA_FLAGS " -x objective-c++")
elseif (UNIX)
# C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -m64")
set(EXTRA_FLAGS "")
endif()
endif()
# Engine Options
option(NordicEngine_OSOnly "Setting OS Only OFF" OFF)
option(NordicEngine_UnitTests "Setting Unit Tests OFF" OFF)
option(NordicEngine_FullEngine "Setting Full Engine ON" ON)
option(ASSIMP_BUILD_ASSIMP_TOOLS "Settings AssImp Tools OFF" OFF)
option(ASSIMP_BUILD_SAMPLES "Settings AssImp Samples OFF" OFF)
option(ASSIMP_BUILD_TESTS "Setting AssImp Tests OFF" OFF)
option(GLFW_BUILD_EXAMPLES "Setting GLFW Examples OFF" OFF)
option(GLFW_BUILD_TESTS "Setting GLFW Tests OFF" OFF)
option(GLFW_BUILD_DOCS "Settings GLFW Docs OFF" OFF)
# Standard Include
include_directories(${PROJECT_SOURCE_DIR}/GameWrapper)
# Set Source
set(Wrap ${PROJECT_SOURCE_DIR}/GameWrapper)
set(WrapperHeaders ${Wrap}/Main.hpp)
set(WrapperSources ${Wrap}/Main.cpp)
# Standard Includes
list(APPEND GameHeaders ${Wrap}/Includes.hpp)
# Build Number
list(APPEND GameHeaders ${Wrap}/buildNumber.hpp)
# NordicEngine
link_directories(${Wrap}/NordicEngine)
include_directories(${Wrap}/NordicEngine)
add_subdirectory(${Wrap}/NordicEngine)
# Game
link_directories(${Wrap}/Game)
include_directories(${Wrap}/Game)
add_subdirectory(${Wrap}/Game)
# Compile
add_executable(GameWrapper ${WrapperSources} ${WrapperHeaders})
set_target_properties(GameWrapper PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(GameWrapper PROPERTIES OUTPUT_NAME ${OutputName})
# Link
target_link_libraries(GameWrapper NordicEngine)
target_link_libraries(GameWrapper GameLibrary)