-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (54 loc) · 2.08 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
74
75
76
77
78
79
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023 Casper Andersson <[email protected]>
cmake_minimum_required(VERSION 3.12)
# ============= Linktest shared ===============
project(tstest VERSION 1.0)
#add_library(link STATIC include/liblink.h src/liblink.c)
#target_include_directories(link PUBLIC ${PROJECT_SOURCE_DIR}/include/)
#macro(m_install)
#endmacro()
set(PROJECT_INCLUDES ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include)
# ============= tstest ===============
project(tstest VERSION 1.0)
# ---- BUILD ----
add_executable(tstest)
target_sources(tstest PRIVATE src/liblink.c src/timestamping.c src/ptp_message.c src/extts.c src/pkt.c src/tstest.c src/delay.c src/check.c)
target_include_directories(tstest PUBLIC ${PROJECT_INCLUDES})
target_link_libraries(tstest PUBLIC)
install(TARGETS tstest
CONFIGURATIONS Debug
RUNTIME DESTINATION bin)
install(TARGETS tstest
CONFIGURATIONS Release
RUNTIME DESTINATION bin)
#m_install(tstest)
add_custom_target(test
COMMAND
unshare -r -n ${PROJECT_SOURCE_DIR}/test/test.sh ${PROJECT_BINARY_DIR}/tstest $(t)
DEPENDS ${PROJECT_BINARY_DIR}/tstest
)
# ============= Configure ===============
configure_file(include/version.h.in include/version.h)
#project(tcalign VERSION 1.0)
##set(PROJECT_NAME_VERSION "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}")
## ---- PROJECT SETUP ----
##set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wpedantic -Wextra")
## ---- BUILD ----
#find_library (LIBNL_LIBRARY nl-3)
#find_library (LIBNL_GENL_LIBRARY nl-genl-3)
#set(LIBNL_LIBRARIES ${LIBNL_LIBRARY} ${LIBNL_GENL_LIBRARY})
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
##set(CMAKE_C_FLAGS
##"${CMAKE_C_FLAGS} -Wall -Wpedantic -Wextra"
##)
#find_path (LIBNL_INCLUDE_DIR NAMES netlink/netlink.h PATH_SUFFIXES libnl3)
#include_directories(include ${LIBNL_INCLUDE_DIR})
#add_executable(tcalign)
#target_sources(tcalign PRIVATE src/tcalign.c)
#install(TARGETS tcalign
#CONFIGURATIONS Debug
#RUNTIME DESTINATION bin)
#install(TARGETS tcalign
#CONFIGURATIONS Release
#RUNTIME DESTINATION bin)
#target_link_libraries(tcalign PUBLIC gpiod ${LIBNL_LIBRARIES})