| 1 |
# - Try to find M |
| 2 |
# Once done this will define |
| 3 |
# |
| 4 |
# M_FOUND - system has M |
| 5 |
# M_INCLUDE_DIR - the M include directory |
| 6 |
# M_LIB - Link these to use M |
| 7 |
# M_VERSION_STRING - Human readable version number of m |
| 8 |
# M_VERSION_MAJOR - Major version number of m |
| 9 |
# M_VERSION_MINOR - Minor version number of m |
| 10 |
|
| 11 |
# Copyright (c) 2017, Ilia Platone, <[email protected]> |
| 12 |
# Based on FindLibfacile by Carsten Niehaus, <[email protected]> |
| 13 |
# |
| 14 |
# Redistribution and use is allowed according to the terms of the BSD license. |
| 15 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
| 16 |
|
| 17 |
if (M_LIB) |
| 18 |
|
| 19 |
# in cache already |
| 20 |
set(M_FOUND TRUE) |
| 21 |
message(STATUS "Found M: ${M_LIB}") |
| 22 |
|
| 23 |
|
| 24 |
else (M_LIB) |
| 25 |
|
| 26 |
find_library(M_LIB NAMES m |
| 27 |
PATHS |
| 28 |
${_obLinkDir} |
| 29 |
${GNUWIN32_DIR}/lib |
| 30 |
/usr/local/lib |
| 31 |
HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} |
| 32 |
) |
| 33 |
|
| 34 |
if(M_LIB) |
| 35 |
set(M_FOUND TRUE) |
| 36 |
else (M_LIB) |
| 37 |
set(M_FOUND FALSE) |
| 38 |
endif(M_LIB) |
| 39 |
|
| 40 |
|
| 41 |
if (M_FOUND) |
| 42 |
if (NOT M_FIND_QUIETLY) |
| 43 |
message(STATUS "Found M: ${M_LIB}") |
| 44 |
endif (NOT M_FIND_QUIETLY) |
| 45 |
else (M_FOUND) |
| 46 |
if (M_FIND_REQUIRED) |
| 47 |
message(FATAL_ERROR "M not found. Please install libm-dev") |
| 48 |
endif (M_FIND_REQUIRED) |
| 49 |
endif (M_FOUND) |
| 50 |
|
| 51 |
mark_as_advanced(M_LIB) |
| 52 |
|
| 53 |
endif (M_LIB) |