forked from rtlabs-com/p-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinux.cmake
121 lines (108 loc) · 3.06 KB
/
Linux.cmake
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#********************************************************************
# _ _ _
# _ __ | |_ _ | | __ _ | |__ ___
# | '__|| __|(_)| | / _` || '_ \ / __|
# | | | |_ _ | || (_| || |_) |\__ \
# |_| \__|(_)|_| \__,_||_.__/ |___/
#
# www.rt-labs.com
# Copyright 2018 rt-labs AB, Sweden.
#
# This software is dual-licensed under GPLv3 and a commercial
# license. See the file LICENSE.md distributed with this software for
# full license information.
#*******************************************************************/
if (PNET_OPTION_SNMP)
find_package(NetSNMP REQUIRED)
find_package(NetSNMPAgent REQUIRED)
endif()
option (USE_SYSLOG
"Use syslog instead of logging to stdout"
OFF)
target_include_directories(profinet
PRIVATE
src/ports/linux
)
target_sources(profinet
PRIVATE
src/ports/linux/pnal.c
src/ports/linux/pnal_eth.c
src/ports/linux/pnal_udp.c
src/ports/linux/pnal_filetools.c
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/pnal_snmp.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/system_mib.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpLocalSystemData.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpLocPortTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpConfigManAddrTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpLocManAddrTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpRemTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpRemManAddrTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpXdot3LocPortTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpXdot3RemPortTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpXPnoLocTable.c>
$<$<BOOL:${PNET_OPTION_SNMP}>:src/ports/linux/mib/lldpXPnoRemTable.c>
)
target_compile_options(profinet
PRIVATE
-Wall
-Wextra
-Werror
-Wno-unused-parameter
-ffunction-sections
-fdata-sections
$<$<BOOL:${USE_SYSLOG}>:-DUSE_SYSLOG>
INTERFACE
$<$<CONFIG:Coverage>:--coverage>
)
target_link_libraries(profinet
PUBLIC
$<$<BOOL:${PNET_OPTION_SNMP}>:NetSNMP::NetSNMPAgent>
$<$<BOOL:${PNET_OPTION_SNMP}>:NetSNMP::NetSNMP>
INTERFACE
$<$<CONFIG:Coverage>:--coverage>
)
target_include_directories(pn_dev
PRIVATE
samples/pn_dev
src/ports/linux
)
target_sources(pn_dev
PRIVATE
samples/pn_dev/sampleapp_common.c
samples/pn_dev/app_utils.c
samples/pn_dev/app_log.c
samples/pn_dev/app_gsdml.c
samples/pn_dev/app_data.c
src/ports/linux/sampleapp_main.c
)
target_compile_options(pn_dev
PRIVATE
-Wall
-Wextra
-Werror
-Wno-unused-parameter
-ffunction-sections
-fdata-sections
)
target_link_options(pn_dev
PRIVATE
-Wl,--gc-sections
)
install (FILES
src/ports/linux/pnal_config.h
DESTINATION include
)
file(COPY
src/ports/linux/set_network_parameters
src/ports/linux/set_profinet_leds
src/ports/linux/set_profinet_leds.raspberrypi
DESTINATION
${PROFINET_BINARY_DIR}/
)
if (BUILD_TESTING)
set(GOOGLE_TEST_INDIVIDUAL TRUE)
target_include_directories(pf_test
PRIVATE
src/ports/linux
)
endif()