5 # Find the native realtime includes and library.
10 # This module defines :prop_tgt:`IMPORTED` target ``LIBM::LIBM``, if
11 # LIBM has been found.
16 # This module defines the following variables:
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.
27 # A user may set ``LIBM_ROOT`` to a math library installation root to tell this
28 # module where to look.
30 find_path(LIBM_INCLUDE_DIRS
32 PATHS /usr/include /usr/local/include /usr/local/bic/include
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)
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}")