forked from oleg68/JackFreqD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (49 loc) · 1.99 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
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)
if(NOT VERSION)
set(VERSION "0.2.1")
endif()
if(NOT BUILD_VERSION)
set(BUILD_VERSION "1")
endif()
project(
JackFreqD
VERSION ${VERSION}
DESCRIPTION "Cpu frequency daemon based on the jack DSP load"
LANGUAGES C
)
# executable
include(FindPkgConfig)
pkg_check_modules(JACK REQUIRED IMPORTED_TARGET jack)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_executable(jackfreqd src/jackfreqd.c src/jack_cpu_load.c src/procps.c)
target_link_libraries(jackfreqd PkgConfig::JACK)
target_link_libraries(jackfreqd Threads::Threads)
install(TARGETS jackfreqd DESTINATION "bin")
# man page
install(FILES man/jackfreqd.1 DESTINATION "man/man1")
# service
install(CODE "configure_file(\"${PROJECT_SOURCE_DIR}/packaging/jackfreq.service.in\" \"\$ENV\{DESTDIR\}\$\{CMAKE_INSTALL_PREFIX\}/lib/systemd/system/jackfreq.service\")")
# packaging
set(CPACK_PACKAGE_NAME "jackfreqd")
set(CPACK_PACKAGE_CONTACT "Oleg Samarin <[email protected]>")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_RELEASE "${BUILD_VERSION}")
set(CPACK_STRIP_FILES ON)
set(CPACK_SOURCE_IGNORE_FILES "/.git/" "/build/" "/nbproject/private/")
set(CPACK_GENERATOR RPM DEB)
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_RPM_PACKAGE_GROUP "Multimedia/Sound")
set(CPACK_RPM_PACKAGE_LICENSE "GPL v2+")
set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}")
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_CONTACT}")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/packaging/prerm")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/packaging/prerm")
set(CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}")
set(CPACK_DEBIAN_PACKAGE_SECTION sound)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/packaging/prerm")
include(CPack)