-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
30 lines (26 loc) · 1.13 KB
/
CMakeLists.txt
File metadata and controls
30 lines (26 loc) · 1.13 KB
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
cmake_minimum_required(VERSION 3.16)
project(HIDProjector)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUDEV REQUIRED libudev)
add_compile_options(-Wall -Wextra)
if (WITH_SERVER)
message("Building server")
# pkg_check_modules(LIBEVDEV REQUIRED libevdev)
pkg_check_modules(LIBUUID REQUIRED uuid)
add_executable(hidpserver hidp_net.cc hidp_proto.cc hidp_device.cc hidp_server.cc hidp_common.cc)
target_compile_definitions(hidpserver PUBLIC -DWITH_UDEV -DWITH_UUID -DWITH_INPUTDEVICE_MONITOR)
target_include_directories(hidpserver PUBLIC ${LIBUDEV_INCLUDE_DIRS})
target_include_directories(hidpserver PUBLIC ${LIBUUID_INCLUDE_DIRS})
target_link_libraries(hidpserver ${LIBUDEV_LIBRARIES})
target_link_libraries(hidpserver ${LIBUUID_LIBRARIES})
endif()
if (WITH_CLIENT)
message("Building client")
add_executable(hidpclient hidp_net.cc hidp_proto.cc hidp_device.cc hidp_client.cc hidp_common.cc)
endif()
if (WITH_TEST)
message("Building test")
add_executable(hid_cat_test test.cpp)
target_include_directories(hidpclient PUBLIC ${LIBUDEV_INCLUDE_DIRS})
target_link_libraries(hidpclient ${LIBUDEV_LIBRARIES})
endif()