-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (47 loc) · 1.46 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
56
57
58
59
cmake_minimum_required(VERSION 3.28)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_STANDARD 20)
file(STRINGS "version.txt" version REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
project(smoothpaper
VERSION ${version}
DESCRIPTION "A wallpaper manager with smooth transitions for X11 Window Managers"
LANGUAGES CXX
)
configure_file(src/Version.hpp.in src/Version.hpp)
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
if (build_type STREQUAL "debug")
add_compile_options(-O0 -g -Wall -Wextra -Wpedantic -Werror)
else()
add_compile_options(-O2 -Wall -Wextra -Wpedantic -Werror)
endif()
# ---- libraries ----
find_package(fmt CONFIG REQUIRED)
find_package(X11 REQUIRED)
find_package(SFML COMPONENTS system window graphics CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(toml11 CONFIG REQUIRED)
find_package(CMakeRC)
# ---- target ----
add_executable(
smoothpaper
src/main.cpp
src/Config.cpp
src/Config.hpp
src/Window.cpp
src/Window.hpp
src/Scaling.cpp
src/Scaling.hpp
)
cmrc_add_resource_library(conf ALIAS smoothpaper::config NAMESPACE conf smoothpaper.toml)
target_compile_features(smoothpaper PRIVATE cxx_std_20)
target_link_libraries(smoothpaper PRIVATE
fmt::fmt
X11::X11
sfml-system sfml-graphics sfml-window
spdlog::spdlog
toml11::toml11
conf
)
target_include_directories(smoothpaper PUBLIC "${PROJECT_BINARY_DIR}/src")
install(TARGETS smoothpaper DESTINATION bin)