-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (62 loc) · 2.13 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
cmake_minimum_required(VERSION 3.0.0)
project(raspberrypi-spotify VERSION 0.1.0 LANGUAGES C CXX)
include(CTest)
enable_testing()
find_package(sdbus-c++ REQUIRED)
find_package(websocketpp REQUIRED)
add_definitions(-DPILED) #Check ColorParser and config it!
set(PILED 1)
if(PILED)
find_package(CURL REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Protobuf REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
endif()
if(PILED)
add_executable(
raspberrypi-spotify
src/main.cpp
src/modules/DBusListener/DBusListener.cpp
src/modules/DBusListener/DBusListener.h
src/modules/WS-server/WSServer.cpp
src/modules/WS-server/WSServer.h
src/modules/Observer.h
src/modules/Subject.h
src/modules/ColorParser/ColorParser.h
src/modules/ColorParser/ColorParser.cpp
)
target_link_libraries(raspberrypi-spotify PRIVATE SDBusCpp::sdbus-c++ websocketpp::websocketpp CURL::libcurl OpenSSL::SSL opencv_highgui)
else()
add_executable(
raspberrypi-spotify
src/main.cpp
src/modules/DBusListener/DBusListener.cpp
src/modules/DBusListener/DBusListener.h
src/modules/WS-server/WSServer.cpp
src/modules/WS-server/WSServer.h
src/modules/Observer.h
src/modules/Subject.h
)
target_link_libraries(raspberrypi-spotify PRIVATE SDBusCpp::sdbus-c++ websocketpp::websocketpp)
endif()
install(TARGETS raspberrypi-spotify DESTINATION bin)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
if(EXISTS "/etc/systemd/user")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/rasp-spot.service
DESTINATION /etc/systemd/user)
message(
STATUS "To start the RaspberryPi Spotify service, run: systemctl --user start rasp-spot"
)
message(
STATUS
"To enable the RaspberryPi Spotify service at boot, run: systemctl --user enable rasp-spot"
)
else()
message(
WARNING
"The /etc/systemd/system directory does not exist. The RaspberryPi Spotify service file was not installed."
)
endif()