]> git.meshlink.io Git - meshlink/blob - src/CMakeLists.txt
1b47d5b498a56572195741fd5224935ee88ae69c
[meshlink] / src / CMakeLists.txt
1 #include(GenerateExportHeader)
2 #generate_export_header(meshlink BASE_NAME meshlink)
3
4 add_library(meshlink SHARED
5         adns.c
6         buffer.c
7         chacha-poly1305/chacha-poly1305.c
8         chacha-poly1305/chacha.c
9         chacha-poly1305/poly1305.c
10         conf.c
11         connection.c
12         crypto.c
13         devtools.c
14         discovery.c
15         dropin.c
16         ed25519/add_scalar.c
17         ed25519/ecdh.c
18         ed25519/ecdsa.c
19         ed25519/ecdsagen.c
20         ed25519/fe.c
21         ed25519/ge.c
22         ed25519/key_exchange.c
23         ed25519/keypair.c
24         ed25519/sc.c
25         ed25519/seed.c
26         ed25519/sha512.c
27         ed25519/sign.c
28         ed25519/verify.c
29         edge.c
30         event.c
31         graph.c
32         hash.c
33         list.c
34         logger.c
35         mdns.c
36         meshlink.c
37         meta.c
38         net.c
39         net_packet.c
40         net_setup.c
41         net_socket.c
42         netutl.c
43         node.c
44         prf.c
45         protocol.c
46         protocol_auth.c
47         protocol_edge.c
48         protocol_key.c
49         protocol_misc.c
50         route.c
51         splay_tree.c
52         sptps.c
53         submesh.c
54         utcp-test.c
55         utcp.c
56         utils.c
57         xoshiro.c
58 )
59
60 set(MESHLINK_PUBLIC_HEADERS
61         meshlink.h
62         meshlink++.h
63 )
64
65 target_compile_features(meshlink PUBLIC c_std_11)
66 target_link_libraries(meshlink PRIVATE Threads::Threads)
67 set_target_properties(meshlink PROPERTIES PUBLIC_HEADER "${MESHLINK_PUBLIC_HEADERS}")
68 set_property(TARGET meshlink PROPERTY C_VISIBILITY_PRESET hidden)
69 set_property(TARGET meshlink PROPERTY C_STANDARD 11)
70
71 include(GNUInstallDirs)
72 install(TARGETS meshlink
73         LIBRARY
74         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
75         PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
76 )