diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/civetweb/cmake/FindLibRt.cmake | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/civetweb/cmake/FindLibRt.cmake | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/civetweb/cmake/FindLibRt.cmake b/src/civetweb/cmake/FindLibRt.cmake new file mode 100644 index 000000000..c496edf86 --- /dev/null +++ b/src/civetweb/cmake/FindLibRt.cmake @@ -0,0 +1,46 @@ +#.rst: +# FindLibRt +# -------- +# +# Find the native realtime includes and library. +# +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines :prop_tgt:`IMPORTED` target ``LIBRT::LIBRT``, if +# LIBRT has been found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following variables: +# +# :: +# +# LIBRT_INCLUDE_DIRS - where to find time.h, etc. +# LIBRT_LIBRARIES - List of libraries when using librt. +# LIBRT_FOUND - True if realtime library found. +# +# Hints +# ^^^^^ +# +# A user may set ``LIBRT_ROOT`` to a realtime installation root to tell this +# module where to look. + +find_path(LIBRT_INCLUDE_DIRS + NAMES time.h + PATHS ${LIBRT_ROOT}/include/ +) +find_library(LIBRT_LIBRARIES rt) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibRt DEFAULT_MSG LIBRT_LIBRARIES LIBRT_INCLUDE_DIRS) +mark_as_advanced(LIBRT_INCLUDE_DIRS LIBRT_LIBRARIES) + +if(LIBRT_FOUND) + if(NOT TARGET LIBRT::LIBRT) + add_library(LIBRT::LIBRT UNKNOWN IMPORTED) + set_target_properties(LIBRT::LIBRT PROPERTIES + IMPORTED_LOCATION "${LIBRT_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBRT_INCLUDE_DIRS}") + endif() +endif() |