-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
75 lines (65 loc) · 1.96 KB
/
CMakeLists.txt
File metadata and controls
75 lines (65 loc) · 1.96 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
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.12)
project(ashwal VERSION 1.0.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
configure_file(${PROJECT_SOURCE_DIR}/include/version.h.in ${PROJECT_BINARY_DIR}/version.h)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel)
endif()
# Find dependencies
find_package(PkgConfig REQUIRED)
pkg_check_modules(MagickWand REQUIRED MagickWand)
pkg_check_modules(imagequant REQUIRED imagequant)
pkg_check_modules(Lua REQUIRED lua)
# Collect source files
set(SOURCES
src/app/cli.c
src/app/config.c
src/app/main.c
src/backends/backend.c
src/backends/ashwal.c
src/backends/libimagequant.c
src/backends/lua_backend.c
src/color/color_convertion.c
src/color/color_operation.c
src/color/colors.c
src/color/image.c
src/modules/cache/cache.c
src/modules/hooks/hooks.c
src/modules/reload/reload.c
src/modules/template/template.c
src/modules/theme/themes.c
src/utils/format_conversion.c
src/utils/path.c
src/utils/utils.c
)
# Create executable
add_executable(ashwal ${SOURCES})
# Include directories
target_include_directories(ashwal PRIVATE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}
${MagickWand_INCLUDE_DIRS}
${imagequant_INCLUDE_DIRS}
${Lua_INCLUDE_DIRS}
)
# Link libraries
target_link_libraries(ashwal
${MagickWand_LIBRARIES}
${imagequant_LIBRARIES}
${Lua_LIBRARIES}
m
)
# Set compiler flags for dependencies
target_compile_options(ashwal PRIVATE
${MagickWand_CFLAGS_OTHER}
${imagequant_CFLAGS_OTHER}
${Lua_CFLAGS_OTHER}
)
# Installation
install(TARGETS ashwal DESTINATION bin)
install(DIRECTORY templates DESTINATION share/ashwal)
install(DIRECTORY themes DESTINATION share/ashwal)