-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.04 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
cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 14)
project(time-sync)
option(BUILD_TESTS No "Build unit tests")
option(NO_CAN_SOCKETS No "Build without CAN sockets support")
if (NOT ${NO_CAN_SOCKETS})
set(CAN_SOCKETS_SRC can-socket.cpp can-socket.h)
endif()
add_library(common-lib STATIC
endpoint.cpp endpoint.h
basic-socket.h
socket-option.cpp socket-option.h
udp-socket.cpp udp-socket.h
socket-factory.cpp socket-factory.h
net-packet.cpp net-packet.h
timestamp-packet.cpp timestamp-packet.h
broadcast-sender.cpp broadcast-sender.h
broadcast-receiver.cpp broadcast-receiver.h
time-printer.h
posix-error-check.h
${CAN_SOCKETS_SRC}
)
add_executable(time-sync-server
server.cpp
)
target_link_libraries(time-sync-server
common-lib
)
add_executable(time-sync-client
client.cpp
)
target_link_libraries(time-sync-client
common-lib
)
if (${NO_CAN_SOCKETS})
target_compile_definitions(common-lib PUBLIC -DNO_CAN_SOCKETS)
endif()
if (BUILD_TESTS)
add_subdirectory(tests)
endif()