-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
CMakeLists.txt
54 lines (42 loc) · 1019 Bytes
/
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
cmake_minimum_required(VERSION 3.13)
project(citro2d
LANGUAGES C ASM
)
include(GNUInstallDirs)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CTR_ROOT}" CACHE PATH "" FORCE)
endif()
# Define static library target
add_library(citro2d STATIC)
set_target_properties(citro2d PROPERTIES DEBUG_POSTFIX "d")
# Add compiler flags
target_compile_options(citro2d PRIVATE
-Wall -Werror -DCITRO2D_BUILD
)
# Add include directories
target_include_directories(citro2d PRIVATE include)
target_sources(citro2d PRIVATE
source/base.c
source/font.c
source/spritesheet.c
source/text.c
)
ctr_add_shader_library(render2d
source/render2d.v.pica
)
dkp_add_embedded_binary_library(c2d_shaders
render2d
)
target_link_libraries(citro2d PRIVATE c2d_shaders)
# Install the library
install(
TARGETS citro2d
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Install headers
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.h"
)