CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/result.cpp
  14. src/limbo/details/checksum.cpp
  15. src/limbo/details/crc32.cpp
  16. src/limbo/ethernet/mac_address.cpp
  17. src/limbo/ip/ipv4_address.cpp
  18. )
  19. target_include_directories(limbo PUBLIC
  20. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  21. $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
  22. $<INSTALL_INTERFACE:include>
  23. )
  24. target_compile_features(limbo PUBLIC cxx_std_17)
  25. set_target_properties(limbo PROPERTIES
  26. CXX_STANDARD 17
  27. CXX_STANDARD_REQUIRED YES
  28. CXX_EXTENSIONS NO
  29. )
  30. if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
  31. include(CTest)
  32. if (BUILD_TESTING)
  33. add_subdirectory("tests")
  34. endif()
  35. endif()