-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (55 loc) · 1.33 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
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.14)
# set( CMAKE_CXX_STANDARD 17 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstackrealign")
project(KGL)
add_library( ${PROJECT_NAME}
./src/Logger.cpp
./src/VertexBuffer.cpp
./src/IndexBuffer.cpp
./src/VertexArray.cpp
./src/VertexBufferLayout.cpp
./src/Shader.cpp
./src/Texture.cpp
./src/Transformation.cpp
./src/Render.cpp
./utils/stb_image/stb_image.cpp
)
target_include_directories( ${PROJECT_NAME} PUBLIC
./inc
./dep/glew/include
./dep/glfw/include
./utils/stb_image
./dep/eigen
)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_directories(${PROJECT_NAME} PUBLIC
./dep/glew/lib/Release/ubuntu18/
./dep/glfw/ubuntu18/
)
target_link_libraries(${PROJECT_NAME} PUBLIC
GLEW
glfw3
GL
-lpthread
-ldl
)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_directories(${PROJECT_NAME} PUBLIC
./dep/glew/lib/Release/Win32/
./dep/glfw/lib-mingw-w64/Win32/
)
target_link_libraries(${PROJECT_NAME} PUBLIC
glew32s
glfw3
Opengl32
Gdi32
)
ENDIF()
set(KGL_EXAMPLE ON)
IF(KGL_EXAMPLE)
message("KGL_EXAMPLE defined")
add_executable(example
example/example.cpp
)
target_link_libraries(example KGL)
ENDIF()