-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (34 loc) · 1.83 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
cmake_minimum_required(VERSION 3.5)
project(VWorld)
set(CMAKE_BINARY_DIR .)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(PROJECT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
if ( CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_CXX_FLAGS "-Wall")
endif ( CMAKE_COMPILER_IS_GNUCC )
add_executable(voxel-world ${PROJECT_SOURCE_DIR}/main.cpp)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/middleware")
include_directories("${PROJECT_SOURCE_DIR}/middleware/stb")
include_directories("${PROJECT_SOURCE_DIR}/Rendering")
include_directories("${PROJECT_SOURCE_DIR}/Rendering/Camera")
include_directories("${PROJECT_SOURCE_DIR}/Helpers")
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIRS})
target_link_libraries(voxel-world glfw GL GLEW freetype pthread)
SET(CMAKE_CXX_FLAGS "-std=c++1y -g -fopenmp")
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Rendering/Window-Management.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Rendering/OpenGL-Wrappers.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Rendering/Renderer.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Rendering/Camera/Camera.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Helpers/wavefront-loader.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Helpers/cout-definitions.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Helpers/tools.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/Cube.cpp)
target_sources(voxel-world PUBLIC ${PROJECT_SOURCE_DIR}/World.cpp)
file(COPY ${PROJECT_SOURCE_DIR}/Rendering/Shaders DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${PROJECT_SOURCE_DIR}/Assets DESTINATION ${CMAKE_BINARY_DIR})