1# Each protocol handler is listed below. If you want
2# to disable some / all of these, comment out the block(s) in question
3
4set(SOURCES
5    # {{BEGIN_TARGET_SOURCES}}
6	${CMAKE_CURRENT_LIST_DIR}/auto_ip/nx_auto_ip.c
7	${CMAKE_CURRENT_LIST_DIR}/cloud/nx_cloud.c
8	${CMAKE_CURRENT_LIST_DIR}/dhcp/nxd_dhcp_client.c
9	${CMAKE_CURRENT_LIST_DIR}/dhcp/nxd_dhcp_server.c
10	${CMAKE_CURRENT_LIST_DIR}/dhcp/nxd_dhcpv6_client.c
11	${CMAKE_CURRENT_LIST_DIR}/dhcp/nxd_dhcpv6_server.c
12	${CMAKE_CURRENT_LIST_DIR}/dns/nxd_dns.c
13	${CMAKE_CURRENT_LIST_DIR}/ftp/nxd_ftp_client.c
14	${CMAKE_CURRENT_LIST_DIR}/ftp/nxd_ftp_server.c
15	${CMAKE_CURRENT_LIST_DIR}/http/nxd_http_client.c
16	${CMAKE_CURRENT_LIST_DIR}/http/nxd_http_server.c
17	${CMAKE_CURRENT_LIST_DIR}/lwm2m/nx_lwm2m_client.c
18	${CMAKE_CURRENT_LIST_DIR}/mdns/nxd_mdns.c
19	${CMAKE_CURRENT_LIST_DIR}/mqtt/nxd_mqtt_client.c
20	${CMAKE_CURRENT_LIST_DIR}/nat/nx_nat.c
21	${CMAKE_CURRENT_LIST_DIR}/pop3/nxd_pop3_client.c
22	${CMAKE_CURRENT_LIST_DIR}/ppp/nx_ppp.c
23	${CMAKE_CURRENT_LIST_DIR}/pppoe/nx_pppoe_client.c
24	${CMAKE_CURRENT_LIST_DIR}/pppoe/nx_pppoe_server.c
25	${CMAKE_CURRENT_LIST_DIR}/ptp/nxd_ptp_client.c
26	${CMAKE_CURRENT_LIST_DIR}/smtp/nxd_smtp_client.c
27	${CMAKE_CURRENT_LIST_DIR}/snmp/nx_des.c
28	${CMAKE_CURRENT_LIST_DIR}/snmp/nx_sha1.c
29	${CMAKE_CURRENT_LIST_DIR}/snmp/nxd_snmp.c
30	${CMAKE_CURRENT_LIST_DIR}/sntp/nxd_sntp_client.c
31	${CMAKE_CURRENT_LIST_DIR}/telnet/nxd_telnet_client.c
32	${CMAKE_CURRENT_LIST_DIR}/telnet/nxd_telnet_server.c
33	${CMAKE_CURRENT_LIST_DIR}/tftp/nxd_tftp_client.c
34	${CMAKE_CURRENT_LIST_DIR}/tftp/nxd_tftp_server.c
35	${CMAKE_CURRENT_LIST_DIR}/web/nx_tcpserver.c
36	${CMAKE_CURRENT_LIST_DIR}/web/nx_web_http_client.c
37	${CMAKE_CURRENT_LIST_DIR}/web/nx_web_http_server.c
38	${CMAKE_CURRENT_LIST_DIR}/websocket/nx_websocket_client.c
39    ${CMAKE_CURRENT_LIST_DIR}/rtp/nx_rtp_sender.c
40    ${CMAKE_CURRENT_LIST_DIR}/rtsp/nx_rtsp_server.c
41
42    # {{END_TARGET_SOURCES}}
43)
44
45# Append BSD file if the user wants it
46if(NXD_ENABLE_BSD)
47    list(APPEND SOURCES
48         ${CMAKE_CURRENT_LIST_DIR}/BSD/nxd_bsd.c
49    )
50endif()
51
52# Append Azure IoT file if the user wants it
53if(NXD_ENABLE_AZURE_IOT)
54    list(APPEND SOURCES
55         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot.c
56         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_hub_client.c
57         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_hub_client_properties.c
58         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_json_reader.c
59         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_json_writer.c
60         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_provisioning_client.c
61         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_adu_agent.c
62         ${CMAKE_CURRENT_LIST_DIR}/azure_iot/nx_azure_iot_adu_root_key.c
63    )
64    set(ENV{AZ_SDK_C_NO_SAMPLES} TRUE)
65    set(NX_AZURE_DISABLE_IOT_SECURITY_MODULE OFF CACHE BOOL "Disable Azure IoT Security Module (default is OFF)")
66    add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/azure_iot/azure-sdk-for-c)
67    if(NX_AZURE_DISABLE_IOT_SECURITY_MODULE)
68        target_compile_definitions(${PROJECT_NAME} PUBLIC -DNX_AZURE_DISABLE_IOT_SECURITY_MODULE)
69    else()
70        add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/azure_iot/azure_iot_security_module)
71    endif()
72endif()
73
74# Remove the file server files if the user doesn't want them
75if(NOT NXD_ENABLE_FILE_SERVERS)
76    list(REMOVE_ITEM SOURCES
77        "${CMAKE_CURRENT_LIST_DIR}/web/nx_web_http_server.c"
78        "${CMAKE_CURRENT_LIST_DIR}/http/nxd_http_server.c"
79        "${CMAKE_CURRENT_LIST_DIR}/ftp/nxd_ftp_server.c"
80        "${CMAKE_CURRENT_LIST_DIR}/tftp/nxd_tftp_server.c"
81    )
82endif()
83
84target_sources(${PROJECT_NAME} PRIVATE ${SOURCES})
85
86target_include_directories(${PROJECT_NAME} PUBLIC
87    ${CMAKE_CURRENT_LIST_DIR}/auto_ip
88    ${CMAKE_CURRENT_LIST_DIR}/azure_iot
89    ${CMAKE_CURRENT_LIST_DIR}/BSD
90    ${CMAKE_CURRENT_LIST_DIR}/cloud
91    ${CMAKE_CURRENT_LIST_DIR}/dhcp
92    ${CMAKE_CURRENT_LIST_DIR}/dns
93    ${CMAKE_CURRENT_LIST_DIR}/ftp
94    ${CMAKE_CURRENT_LIST_DIR}/http
95    ${CMAKE_CURRENT_LIST_DIR}/lwm2m
96    ${CMAKE_CURRENT_LIST_DIR}/mdns
97    ${CMAKE_CURRENT_LIST_DIR}/mqtt
98    ${CMAKE_CURRENT_LIST_DIR}/nat
99    ${CMAKE_CURRENT_LIST_DIR}/pop3
100    ${CMAKE_CURRENT_LIST_DIR}/ppp
101    ${CMAKE_CURRENT_LIST_DIR}/pppoe
102    ${CMAKE_CURRENT_LIST_DIR}/ptp
103    ${CMAKE_CURRENT_LIST_DIR}/smtp
104    ${CMAKE_CURRENT_LIST_DIR}/snmp
105    ${CMAKE_CURRENT_LIST_DIR}/sntp
106    ${CMAKE_CURRENT_LIST_DIR}/telnet
107    ${CMAKE_CURRENT_LIST_DIR}/tftp
108    ${CMAKE_CURRENT_LIST_DIR}/web
109    ${CMAKE_CURRENT_LIST_DIR}/websocket
110    ${CMAKE_CURRENT_LIST_DIR}/rtp
111    ${CMAKE_CURRENT_LIST_DIR}/rtsp
112)
113