-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
50 lines (41 loc) · 1.4 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
cmake_minimum_required(VERSION 2.8)
project(demo-scene)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
# CMAKE extensions
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
# Required packages
find_package(OpenGL REQUIRED)
find_package(SDL2 REQUIRED)
find_package(GLEW REQUIRED)
find_package(Freetype REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c++11")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
endif()
# include locations
include_directories(${SDL2_INCLUDE_DIR})
include_directories("${CMAKE_SOURCE_DIR}/src")
include_directories(${FREETYPE_INCLUDE_DIRS})
set(SOURCES
src/main.cpp
src/application/Application.cpp
src/utils/BaseLog.cpp
src/utils/COutLog.cpp
src/application/Shader.cpp
src/application/Object.cpp
src/application/Character.cpp
src/structures/BaseScene.cpp
src/structures/SceneCube.cpp
)
add_executable(demo ${SOURCES})
target_link_libraries(demo
${SDL2_LIBRARY}
${OPENGL_LIBRARIES}
GLEW
freetype
)