-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
45 lines (36 loc) · 1.31 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
# Set minimum CMake version.
cmake_minimum_required(VERSION 3.17)
# Create project.
project(ClevoFanControl C)
# Enable the language standard.
set(CMAKE_C_STANDARD 99)
# Explicitly link the math library.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm")
# Add the main executable.
add_executable(clevo-fan-control src/main.c)
# Use the package PkgConfig to detect dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(APPINDICATOR REQUIRED appindicator3-0.1)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
# Include the dependencies.
include_directories(${APPINDICATOR_INCLUDE_DIRS})
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
# Add other flags to the compiler
add_definitions(${GTK3_CFLAGS_OTHER})
# Link the target to the dependencies.
target_link_libraries(clevo-fan-control ${APPINDICATOR_LIBRARIES} ${GTK3_LIBRARIES})
# Specify installation rules.
install(
TARGETS clevo-fan-control
PERMISSIONS WORLD_EXECUTE OWNER_WRITE OWNER_READ SETUID GROUP_EXECUTE
DESTINATION bin
)
install(
FILES src/clevo-fan-control.desktop
PERMISSIONS WORLD_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE
DESTINATION ~/.config/autostart
)
install (
CODE "execute_process(COMMAND sudo chown ${USER}:${GROUP} ${HOME}/.config/autostart/clevo-fan-control.desktop)"
)