-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
55 lines (46 loc) · 1.48 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
cmake_minimum_required(VERSION 3.28)
project(led-matrix-zmq-server)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(LMZ_COMPILE_FEATURES cxx_std_20)
set(LMZ_COMPILE_OPTIONS -O3 -Wall -Wextra)
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZMQ REQUIRED libzmq)
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
GIT_TAG v3.1
)
FetchContent_Declare(
plog
GIT_REPOSITORY https://github.com/SergiusTheBest/plog.git
GIT_TAG 1.1.10
)
FetchContent_MakeAvailable(argparse plog)
if(
CMAKE_SYSTEM_PROCESSOR MATCHES "arm"
OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64"
)
find_package(RpiRgbLedMatrix REQUIRED)
add_executable(led-matrix-zmq-server
src/server_main.cpp
src/color_temp.cpp
)
target_link_libraries(led-matrix-zmq-server PRIVATE
argparse
plog
pthread
RpiRgbLedMatrix::RpiRgbLedMatrix
zmq
)
target_compile_features(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_FEATURES})
target_compile_options(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_OPTIONS})
endif()
add_executable(led-matrix-zmq-control
src/control_main.cpp
)
target_link_libraries(led-matrix-zmq-control PRIVATE argparse plog zmq)
target_compile_features(led-matrix-zmq-control PRIVATE ${LMZ_COMPILE_FEATURES})
add_executable(led-matrix-zmq-pipe src/pipe_main.cpp)
target_link_libraries(led-matrix-zmq-pipe PRIVATE argparse plog zmq)
target_compile_features(led-matrix-zmq-pipe PRIVATE ${LMZ_COMPILE_FEATURES})