You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.1 KiB

  1. --- /dev/null
  2. +++ b/cmake/FindAtomic.cmake
  3. @@ -0,0 +1,11 @@
  4. +find_library(ATOMIC_LIBRARIES NAMES atomic
  5. + HINTS ${ATOMIC_LIBRARIES_DIR_HINT})
  6. +
  7. +include(FindPackageHandleStandardArgs)
  8. +find_package_handle_standard_args(Atomic DEFAULT_MSG ATOMIC_LIBRARIES)
  9. +
  10. +mark_as_advanced(ATOMIC_LIBRARIES)
  11. +
  12. +if (ATOMIC_LIBRARIES)
  13. + set(HAVE_ATOMIC "1")
  14. +endif()
  15. --- a/cmake/include_libraries.cmake
  16. +++ b/cmake/include_libraries.cmake
  17. @@ -15,6 +15,7 @@ if (ENABLE_UNIT_TESTS)
  18. endif (ENABLE_UNIT_TESTS)
  19. # optional libraries
  20. +find_package(Atomic QUIET)
  21. find_package(LibLZMA QUIET)
  22. find_package(Asciidoc QUIET)
  23. find_package(DBLATEX QUIET)
  24. --- a/CMakeLists.txt
  25. +++ b/CMakeLists.txt
  26. @@ -116,6 +116,14 @@ else ()
  27. DAQ Modules: Dynamic")
  28. endif ()
  29. +if (HAVE_ATOMIC)
  30. + message("\
  31. + libatomic: ON")
  32. +else ()
  33. + message("\
  34. + libatomic: OFF")
  35. +endif ()
  36. +
  37. if (HAVE_FLATBUFFERS)
  38. message("\
  39. Flatbuffers: ON")
  40. --- a/configure_cmake.sh
  41. +++ b/configure_cmake.sh
  42. @@ -108,6 +108,8 @@ Optional Packages:
  43. libhs include directory
  44. --with-hyperscan-libraries=DIR
  45. libhs library directory
  46. + --with-atomic-libraries=DIR
  47. + atomic library directory
  48. --with-flatbuffers-includes=DIR
  49. flatbuffers include directory
  50. --with-flatbuffers-libraries=DIR
  51. @@ -447,6 +449,9 @@ while [ $# -ne 0 ]; do
  52. --with-hyperscan-libraries=*)
  53. append_cache_entry HS_LIBRARIES_DIR PATH $optarg
  54. ;;
  55. + --with-atomic-libraries=*)
  56. + append_cache_entry ATOMIC_LIBRARIES_DIR_HINT PATH $optarg
  57. + ;;
  58. --with-flatbuffers-includes=*)
  59. append_cache_entry FLATBUFFERS_INCLUDE_DIR_HINT PATH $optarg
  60. ;;
  61. --- a/src/CMakeLists.txt
  62. +++ b/src/CMakeLists.txt
  63. @@ -25,6 +25,10 @@ set(EXTERNAL_INCLUDES
  64. ${ZLIB_INCLUDE_DIRS}
  65. )
  66. +if ( HAVE_ATOMIC )
  67. + LIST(APPEND EXTERNAL_LIBRARIES ${ATOMIC_LIBRARIES})
  68. +endif()
  69. +
  70. if ( ENABLE_STATIC_DAQ )
  71. LIST(APPEND EXTERNAL_LIBRARIES ${DAQ_STATIC_MODULE_LIBS})
  72. endif ()