-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
55 lines (44 loc) · 1.15 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
cmake_minimum_required(VERSION 3.15.7)
project(sgg VERSION 1.0.0 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Wrap_GLEW MODULE REQUIRED)
find_package(Wrap_glm MODULE REQUIRED)
find_package(Wrap_SDL2 MODULE REQUIRED)
find_package(Wrap_Freetype MODULE REQUIRED)
find_package(Wrap_SDL2_mixer MODULE REQUIRED)
add_library(sgg
sgg/audio.cpp
sgg/AudioManager.cpp
sgg/fonts.cpp
sgg/GLbackend.cpp
sgg/graphics.cpp
sgg/lodepng.cpp
sgg/shader.cpp
sgg/texture.cpp
)
target_include_directories(sgg
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(sgg
PUBLIC
$<TARGET_NAME_IF_EXISTS:glm::glm>
$<TARGET_NAME_IF_EXISTS:GLEW::glew>
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2>
$<TARGET_NAME_IF_EXISTS:Freetype::Freetype>
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2_mixer>
)
include(cmake/Installation.cmake)
add_library(sgg::sgg ALIAS sgg)
add_executable(demo
demo/demo.cpp
)
target_include_directories(demo
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/demo>
)
target_link_libraries(demo
PRIVATE
sgg::sgg
)