-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
52 lines (43 loc) · 1.57 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
cmake_minimum_required(VERSION 3.10)
project(anvilock)
# Set C standard
set(CMAKE_C_STANDARD 11)
# Find Freetype
find_package(Freetype REQUIRED)
# Include directories
include_directories(${FREETYPE_INCLUDE_DIRS} toml)
# Add executable
add_executable(anvilock main.c toml/toml.c)
# Link libraries
target_link_libraries(anvilock
PRIVATE
${FREETYPE_LIBRARIES}
wayland-client
wayland-server
wayland-egl
EGL
GLESv2
pam
xkbcommon
m
)
# Enable warnings
target_compile_options(anvilock PRIVATE -Wall -Wextra -Wpedantic -g)
# Define the config path
set(CONFIG_DIR "$ENV{HOME}/.config/anvilock")
set(CONFIG_FILE "${CONFIG_DIR}/config.toml")
# Create config.toml if it doesn't exist
add_custom_command(
OUTPUT ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CONFIG_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "[font]" > ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "name = \"# your font name goes here\"" >> ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "path = \"# your font path goes here\"" >> ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "" >> ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "[bg]" >> ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "name = \"# your background name goes here\"" >> ${CONFIG_FILE}
COMMAND ${CMAKE_COMMAND} -E echo "path = \"# your background path goes here\"" >> ${CONFIG_FILE}
COMMENT "Creating config.toml with placeholder values."
)
add_custom_target(create_config ALL DEPENDS ${CONFIG_FILE})
add_dependencies(anvilock create_config)