-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1.36 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
cmake_minimum_required(VERSION 3.0)
project(terrain)
include_directories(include)
link_directories(${CMAKE_SOURCE_DIR}/lib)
include_directories(${CMAKE_BINARY_DIR}/include)
add_compile_options(-m64)
set(ENGINE_NAME engine)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "-O4")
set(BUILD_SHARED_LIBS True)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_BUILD_TYPE Release)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLM REQUIRED)
find_package(GLFW3 REQUIRED)
find_package(ASSIMP REQUIRED)
find_package(Freetype REQUIRED)
set(LIBS glfw gdi32 opengl32 glew32 assimp zlibstatic)
include_directories(
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/include"
)
#make stb_image lib
add_library(stb_image ${CMAKE_SOURCE_DIR}/src/stb_image.cpp)
set(LIBS ${LIBS} stb_image)
#make engine lib
file(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/src/engine/*.cpp)
add_library(${ENGINE_NAME} ${SOURCES})
set(LIBS ${LIBS} ${FREETYPE_LIBRARIES})
target_link_libraries(${ENGINE_NAME} ${LIBS})
target_include_directories(${ENGINE_NAME} PRIVATE ${FREETYPE_INCLUDE_DIRS})
#make exe file
file(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/src/generator/*.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(
${PROJECT_NAME}
${ENGINE_NAME}
)