zhangmeng
2024-04-22 16935f4aebffdd1b6580b844391a0aa0f4f3012b
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
#
# Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
# Copyright 2018 Capitar IT Group BV <info@capitar.com>
#
# This software is supplied under the terms of the MIT License, a
# copy of which should be located in the distribution where this
# file was obtained (LICENSE.txt).  A copy of the license may also be
# found online at https://opensource.org/licenses/MIT.
#
 
# ZeroTier protocol
 
option (NNG_TRANSPORT_ZEROTIER "Enable ZeroTier transport (requires libzerotiercore)." OFF)
mark_as_advanced(NNG_TRANSPORT_ZEROTIER)
 
nng_directory(zerotier)
 
if (NNG_TRANSPORT_ZEROTIER)
 
    # NB: As we wind up linking libzerotiercore.a into the application,
    # this means that your application will *also* need to either be licensed
    # under the GPLv3, or you will need to have a commercial license from
    # ZeroTier permitting its use elsewhere.
 
    message(WARNING "
        ************************************************************
        Linking against zerotiercore changes license terms.
        Consult a lawyer and the license files for details.
        ************************************************************")
 
    find_package(zerotiercore REQUIRED)
 
    nng_link_libraries(zerotiercore::zerotiercore)
    nng_defines(NNG_TRANSPORT_ZEROTIER)
    nng_sources(zerotier.c zthash.c)
    nng_headers(nng/transport/zerotier/zerotier.h)
endif()