aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindMATH.cmake
blob: 74175c34b3c879250c6dda4c176cd171e23bde79 (plain)
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
# - Find math
# Find the native MATH includes and library
#
#  MATH_INCLUDE_DIR - where to find math.h, etc.
#  MATH_LIBRARIES   - List of libraries when using math.
#  MATH_FOUND       - True if math found.


IF (MATH_INCLUDE_DIR)
  # Already in cache, be silent
  SET(MATH_FIND_QUIETLY TRUE)
ENDIF (MATH_INCLUDE_DIR)

FIND_PATH(MATH_INCLUDE_DIR math.h)

SET(MATH_NAMES m)
FIND_LIBRARY(MATH_LIBRARY NAMES ${MATH_NAMES} )

# handle the QUIETLY and REQUIRED arguments and set MATH_FOUND to TRUE if 
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATH DEFAULT_MSG MATH_LIBRARY MATH_INCLUDE_DIR)

IF(MATH_FOUND)
  SET( MATH_LIBRARIES ${MATH_LIBRARY} )
ELSE(MATH_FOUND)
  SET( MATH_LIBRARIES )
ENDIF(MATH_FOUND)

MARK_AS_ADVANCED( MATH_LIBRARY MATH_INCLUDE_DIR )