File: FindM.cmake

package info (click to toggle)
libahp-gt 1.7.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 444 kB
  • sloc: ansic: 2,459; sh: 15; makefile: 3
file content (53 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# - Try to find M
# Once done this will define
#
#  M_FOUND - system has M
#  M_INCLUDE_DIR - the M include directory
#  M_LIB - Link these to use M
#  M_VERSION_STRING - Human readable version number of m
#  M_VERSION_MAJOR  - Major version number of m
#  M_VERSION_MINOR  - Minor version number of m

# Copyright (c) 2017, Ilia Platone, <info@iliaplatone.com>
# Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (M_LIB)

  # in cache already
  set(M_FOUND TRUE)
  message(STATUS "Found M: ${M_LIB}")


else (M_LIB)

  find_library(M_LIB NAMES m
    PATHS
    ${_obLinkDir}
    ${GNUWIN32_DIR}/lib
    /usr/local/lib
    HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
  )

  if(M_LIB)
    set(M_FOUND TRUE)
  else (M_LIB)
    set(M_FOUND FALSE)
  endif(M_LIB)


  if (M_FOUND)
    if (NOT M_FIND_QUIETLY)
      message(STATUS "Found M: ${M_LIB}")
    endif (NOT M_FIND_QUIETLY)
  else (M_FOUND)
    if (M_FIND_REQUIRED)
      message(FATAL_ERROR "M not found. Please install libm-dev")
    endif (M_FIND_REQUIRED)
  endif (M_FOUND)

  mark_as_advanced(M_LIB)
  
endif (M_LIB)