]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/cmake/FindLibM.cmake
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / civetweb / cmake / FindLibM.cmake
1 #.rst:
2 # FindLibM
3 # --------
4 #
5 # Find the native realtime includes and library.
6 #
7 # IMPORTED Targets
8 # ^^^^^^^^^^^^^^^^
9 #
10 # This module defines :prop_tgt:`IMPORTED` target ``LIBM::LIBM``, if
11 # LIBM has been found.
12 #
13 # Result Variables
14 # ^^^^^^^^^^^^^^^^
15 #
16 # This module defines the following variables:
17 #
18 # ::
19 #
20 # LIBM_INCLUDE_DIRS - where to find math.h, etc.
21 # LIBM_LIBRARIES - List of libraries when using libm.
22 # LIBM_FOUND - True if math library found.
23 #
24 # Hints
25 # ^^^^^
26 #
27 # A user may set ``LIBM_ROOT`` to a math library installation root to tell this
28 # module where to look.
29
30 find_path(LIBM_INCLUDE_DIRS
31 NAMES math.h
32 PATHS /usr/include /usr/local/include /usr/local/bic/include
33 NO_DEFAULT_PATH
34 )
35 find_library(LIBM_LIBRARIES m)
36 include(FindPackageHandleStandardArgs)
37 find_package_handle_standard_args(LibM DEFAULT_MSG LIBM_LIBRARIES LIBM_INCLUDE_DIRS)
38 mark_as_advanced(LIBM_INCLUDE_DIRS LIBM_LIBRARIES)
39
40 if(LIBM_FOUND)
41 if(NOT TARGET LIBM::LIBM)
42 add_library(LIBM::LIBM UNKNOWN IMPORTED)
43 set_target_properties(LIBM::LIBM PROPERTIES
44 IMPORTED_LOCATION "${LIBM_LIBRARIES}"
45 INTERFACE_INCLUDE_DIRECTORIES "${LIBM_INCLUDE_DIRS}")
46 endif()
47 endif()