CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cmake_minimum_required(VERSION 3.13)
  2. if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
  3. cmake_policy(SET CMP0074 NEW)
  4. endif()
  5. project (limbo LANGUAGES CXX)
  6. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
  7. if (NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET AND
  8. NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN)
  9. set(CMAKE_CXX_VISIBILITY_PRESET hidden)
  10. set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
  11. endif ()
  12. add_library(limbo
  13. src/limbo/chunk.cpp
  14. src/limbo/result.cpp
  15. src/limbo/details/checksum.cpp
  16. src/limbo/details/crc32.cpp
  17. src/limbo/ethernet/mac_address.cpp
  18. src/limbo/ip/ipv4_address.cpp
  19. )
  20. target_include_directories(limbo PUBLIC
  21. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  22. $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
  23. $<INSTALL_INTERFACE:include>
  24. )
  25. target_compile_features(limbo PUBLIC cxx_std_17)
  26. set_target_properties(limbo PROPERTIES
  27. CXX_STANDARD 17
  28. CXX_STANDARD_REQUIRED YES
  29. CXX_EXTENSIONS NO
  30. )
  31. if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
  32. include(CTest)
  33. if (BUILD_TESTING)
  34. add_subdirectory("tests")
  35. endif()
  36. endif()