forked from mortendynamite/g19daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·74 lines (52 loc) · 2.63 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
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.1)
project(g19daemon)
set(CPACK_RPM_PACKAGE_SUMMARY "G19daemon provides multiple virtual screens for the LCD on the Logitech G19 Keyboar")
set(CPACK_RPM_PACKAGE_NAME "g19deamon")
set(CPACK_RPM_PACKAGE_DESCRIPTION "G19daemon provides multiple virtual screens for the LCD on the Logitech G19 Keyboar")
include(CPack)
set(VERSION_MAJOR 0 CACHE STRING "Major version" FORCE)
set(VERSION_MINOR 1 CACHE STRING "Minor version" FORCE)
set(VERSION_REVISION 2 CACHE STRING "Revison" FORCE)
set(PLUGINS_DIR lib/g19daemon/${VERSION_MAJOR}.${VERSION_MINOR}/plugins CACHE PATH "Path to installed plugins")
set(THEMES_DIR lib/g19daemon/${VERSION_MAJOR}.${VERSION_MINOR}/themes CACHE PATH "Path to installed themes")
# Forbid in-tree building
if(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
message(STATUS "Please do an out-of-tree build:")
message(STATUS "rm -f CMakeCache.txt && mkdir build && cd build; cmake .. && make")
message(FATAL_ERROR "In-tree-build detected!")
endif(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -ggdb")
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(libusb-1.0 REQUIRED)
find_package(PulseAudio REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${LIBUSB_1_INCLUDE_DIRS})
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -ggdb")
configure_file(src/config.h.in config.h)
set(g19daemon_SRC
src/main.cpp
src/g19daemon.cpp
src/g19device.cpp
src/gscreen.cpp
)
qt5_add_resources(g19daemon_QRC src/g19daemon.qrc)
add_executable(g19daemon ${g19daemon_SRC} ${g19daemon_QRC})
target_link_libraries(g19daemon ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${LIBUSB_1_LIBRARIES} ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY})
qt5_use_modules(g19daemon Core Gui)
install(TARGETS g19daemon RUNTIME DESTINATION bin)
install(PROGRAMS src/g19daemon.desktop DESTINATION share/applications)
install(FILES helper/80-hid-g19.rules DESTINATION /etc/udev/rules.d)
add_subdirectory(src/plugins/helloworld)
add_subdirectory(src/plugins/keybacklight)
add_subdirectory(src/plugins/backlight)
add_subdirectory(src/plugins/pavolume)
add_subdirectory(src/plugins/mpris)
add_subdirectory(src/plugins/clock)
add_subdirectory(src/plugins/hardwaremonitor)