-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
48 lines (38 loc) · 1.08 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
cmake_minimum_required(VERSION 3.27)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_REQUIRED ON)
project(littlecraftGL)
file(GLOB_RECURSE SRC_FILES src/*.c*)
file(GLOB_RECURSE SHADERS_FILES shaders/*)
file(GLOB_RECURSE RES_FILES res/*)
file(COPY ${SHADERS_FILES} DESTINATION ${CMAKE_BINARY_DIR}/shaders)
file(COPY ${RES_FILES} DESTINATION ${CMAKE_BINARY_DIR}/res)
find_package(OpenGL REQUIRED)
add_executable(littlecraftGL ${SRC_FILES})
set(CMAKE_CXX_FLAGS "-Wall -Wextra -O3")
if(WIN32)
# set stuff for windows
target_include_directories(littlecraftGL
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}/src/imgui
${USERPROFILE}/glfw/include
${USERPROFILE}/glm
${USERPROFILE}/stb)
target_link_libraries(littlecraftGL
PUBLIC
opengl32
glfw3
pthread)
else()
target_include_directories(littlecraftGL
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}/src/imgui
${OPENGL_INCLUDE_DIR})
target_link_libraries(littlecraftGL
PUBLIC
GL
glfw
pthread)
endif()