-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
65 lines (57 loc) · 1.73 KB
/
CMakeLists.txt
File metadata and controls
65 lines (57 loc) · 1.73 KB
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
63
64
65
# Just UI
cmake_minimum_required(VERSION 3.16)
project(JustUI VERSION 1.4.0 LANGUAGES C)
find_package(Gint 2.11 REQUIRED)
include(Fxconv)
set(CMAKE_INSTALL_MESSAGE LAZY)
configure_file(include/justui/config.h.in include/justui/config.h)
set(ASSETS_fx
assets/input-modes-fx.png
assets/font-fkeys-fx.png
)
set(ASSETS_cg
assets/input-modes-cg.png
)
set(ASSETS_cp ${ASSETS_cg})
fxconv_declare_assets(${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
set(NAME "justui-${FXSDK_PLATFORM}")
add_library(${NAME} STATIC
src/jwidget.c
src/jlayout_box.c
src/jlayout_stack.c
src/jlayout_grid.c
src/jlabel.c
src/jscene.c
src/jinput.c
src/jpainted.c
src/jfkeys.c
src/jfileselect.c
src/jframe.c
src/jlist.c
src/jscrolledlist.c
src/jbutton.c
src/vec.c
src/keymap.c
${ASSETS_${FXSDK_PLATFORM}}
)
target_compile_options(${NAME} PUBLIC
-Wall -Wextra -std=c11 -Os -flto)
target_include_directories(${NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include")
target_link_libraries(${NAME}
Gint::Gint -lm)
# Generate the archive with gcc-ar instead of ar as it will load the LTO plugin
# which is required to generate a usable archive.
set(CMAKE_C_ARCHIVE_CREATE "${CMAKE_C_COMPILER_AR} qcs <TARGET> <OBJECTS>")
# Also the ranlib rule (useless because ar is passed the s flag anyway)
set(CMAKE_C_ARCHIVE_FINISH "${CMAKE_C_COMPILER_RANLIB} <TARGET>")
install(TARGETS ${NAME}
DESTINATION "${FXSDK_LIB}")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION "${FXSDK_INCLUDE}"
FILES_MATCHING PATTERN "*.h")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/justui/config.h"
DESTINATION "${FXSDK_INCLUDE}/justui")
install(FILES cmake/FindJustUI.cmake
DESTINATION "${FXSDK_CMAKE_MODULE_PATH}")