This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
54 lines (43 loc) · 1.67 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
#VS 2017 introduced in this version
cmake_minimum_required(VERSION 3.7.2)
#Specify build types
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configurations" FORCE)
#Name of the project
project(Engine)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
#Adding path for custom cmake modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
)
#Adding a global variable where the dependencies of the project lives
set(dependencies "${CMAKE_CURRENT_SOURCE_DIR}/pilcrow/dependencies")
#Specify the root directory of the libraries
if(MSVC)
set(GLFW_ROOT "${dependencies}/glfw/glfw-3.2.1")
set(ASSIMP_ROOT "${dependencies}/assimp/assimp-4.0.1")
set(GTEST_ROOT "${dependencies}/googletest/googletest-1.8.0")
set(GLM_ROOT "${dependencies}/glm/glm-0.9.9.0")
set(FREETYPE_ROOT "${dependencies}/freetype/freetype-2.9")
set(CPPREST_ROOT "${dependencies}/cpprestsdk/cpprestsdk-2.10.0")
set(DETECTION_IDIOM_ROOT "${dependencies}/detection_idiom")
set(SLOT_MAP_ROOT "${dependencies}/slot_map")
endif(MSVC)
#Finding the specified libraries to be included later
find_package(GLFW)
find_package(ASSIMP)
find_package(FREETYPE)
find_package(CPPREST)
find_package(GTEST)
find_package(OpenGL)
#Set Visual Studio startup project to "restful_runtime"
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "restful_runtime" )
#Specify compiler flags for MSVC to use the latest c++
if (MSVC_VERSION GREATER_EQUAL "1900")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("/std:c++latest" _cpp_latest_flag_supported)
if (_cpp_latest_flag_supported)
add_compile_options("/std:c++latest")
endif()
endif()
add_subdirectory(pilcrow)