This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
47 lines (34 loc) · 1.53 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
cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
project(3d-cpu-engine)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "in-source build not allowed. Use another directory.")
endif()
# ------------------------------------------------------------------------------
# Compiler Flags
# ------------------------------------------------------------------------------
message(STATUS "Detected Operating System: ${CMAKE_SYSTEM_NAME}")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No BUILD_TYPE set: uses Release")
message(STATUS "Available build types: Debug Release RelWithDebInfo MinSizeRel")
set(CMAKE_BUILD_TYPE Release)
endif()
# ------------------------------------------------------------------------------
# Dependencies
# ------------------------------------------------------------------------------
set(dependency_dir "${CMAKE_SOURCE_DIR}/dependencies/")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/")
find_package(SDL2 REQUIRED)
# ------------------------------------------------------------------------------
# Tests
# ------------------------------------------------------------------------------
option(build_tests "Build unit tests" ON)
if(build_tests)
message(STATUS "Tests enabled")
add_subdirectory(test)
endif()
# ------------------------------------------------------------------------------
# Engine Executable
# ------------------------------------------------------------------------------
add_subdirectory(src)