CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. cmake_minimum_required (VERSION 2.8)
  2. project(zt_core)
  3. configure_file(
  4. version.h.in
  5. version.h
  6. )
  7. set(core_headers
  8. zerotier.h
  9. Address.hpp
  10. Blob.hpp
  11. Buf.hpp
  12. C25519.hpp
  13. CapabilityCredential.hpp
  14. Certificate.hpp
  15. MembershipCredential.hpp
  16. OwnershipCredential.hpp
  17. Constants.hpp
  18. Containers.hpp
  19. Credential.hpp
  20. Defragmenter.hpp
  21. Dictionary.hpp
  22. ECC384.hpp
  23. EphemeralKey.hpp
  24. Expect.hpp
  25. FCV.hpp
  26. Fingerprint.hpp
  27. Identity.hpp
  28. InetAddress.hpp
  29. Locator.hpp
  30. LZ4.hpp
  31. MAC.hpp
  32. Member.hpp
  33. MulticastGroup.hpp
  34. Mutex.hpp
  35. Network.hpp
  36. NetworkConfig.hpp
  37. Node.hpp
  38. OS.hpp
  39. Path.hpp
  40. Peer.hpp
  41. Poly1305.hpp
  42. Protocol.hpp
  43. RuntimeEnvironment.hpp
  44. Salsa20.hpp
  45. ScopedPtr.hpp
  46. SelfAwareness.hpp
  47. SHA512.hpp
  48. SharedPtr.hpp
  49. SymmetricKey.hpp
  50. TagCredential.hpp
  51. Topology.hpp
  52. Trace.hpp
  53. TriviallyCopyable.hpp
  54. Utils.hpp
  55. VL1.hpp
  56. VL2.hpp
  57. )
  58. set(core_src
  59. AES.cpp
  60. Buf.cpp
  61. C25519.cpp
  62. CapabilityCredential.cpp
  63. Certificate.cpp
  64. MembershipCredential.cpp
  65. OwnershipCredential.cpp
  66. Credential.cpp
  67. Dictionary.cpp
  68. ECC384.cpp
  69. Endpoint.cpp
  70. Identity.cpp
  71. InetAddress.cpp
  72. Locator.cpp
  73. LZ4.cpp
  74. Member.cpp
  75. Network.cpp
  76. NetworkConfig.cpp
  77. Node.cpp
  78. Path.cpp
  79. Peer.cpp
  80. Poly1305.cpp
  81. RevocationCredential.cpp
  82. Salsa20.cpp
  83. SelfAwareness.cpp
  84. SHA512.cpp
  85. TagCredential.cpp
  86. Topology.cpp
  87. Trace.cpp
  88. Utils.cpp
  89. VL1.cpp
  90. VL2.cpp
  91. )
  92. add_library(${PROJECT_NAME} STATIC ${core_src} ${core_headers})
  93. target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
  94. target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR})
  95. if(WIN32)
  96. set(libs ${libs} wsock32 ws2_32 rpcrt4 iphlpapi)
  97. else(WIN32)
  98. set(libs ${libs} pthread)
  99. endif(WIN32)
  100. add_executable(zt_core_tests Tests.h Tests.cpp)
  101. target_compile_definitions(zt_core_tests PRIVATE ZT_ENABLE_TESTS=1 ZT_STANDALONE_TESTS=1)
  102. target_include_directories(
  103. ${PROJECT_NAME}
  104. PUBLIC
  105. ${CMAKE_BINARY_DIR}/core
  106. )
  107. target_link_libraries(zt_core_tests zt_core ${libs})