Blame view

cmake/FindFANN.cmake 1.66 KB
29165fa9   David Mayerich   added ROC curve c...
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  #
  # Windows users: define the GLEW_PATH environment variable to point
  # to the directory containing:
  #   include/fann.h
  #   lib/*fann.lib
  
  
  #  FANN_FOUND - system has fann
  #  FANN_INCLUDE_DIRS - the fann include directory
  #  FANN_LIBRARIES - Link these to use fann
  #  FANN_DEFINITIONS - Compiler switches required for using fann
  #
  
  if(FANN_LIBRARIES AND FANN_INCLUDE_DIRS)
    set(FANN_FOUND TRUE)
  else()
    find_path(FANN_INCLUDE_DIR
      NAMES
        fann.h
      PATHS
        $ENV{FANN_PATH}/include
        ${FANN_DIR}/include
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
    )
  
    set( _libraries fann doublefann fixedfann floatfann )
  
    foreach( _lib ${_libraries} )
      string( TOUPPER ${_lib} _name )
  
      find_library(${_name}_LIBRARY
        NAMES
          ${_lib}
        PATHS
          $ENV{FANN_PATH}/lib
          ${FANN_DIR}/lib
          /usr/lib
          /usr/local/lib
          /opt/local/lib
          /sw/lib
        )
  
    endforeach()
  
  
    set(FANN_INCLUDE_DIRS
      ${FANN_INCLUDE_DIR}
    )
  
    set(FANN_LIBRARIES
      ${FANN_LIBRARIES}
      ${FANN_LIBRARY}
      ${DOUBLEFANN_LIBRARY}
      ${FIXEDFANN_LIBRARY}
      ${FLOATFANN_LIBRARY}
    )
  
    if( UNIX )
      set( FANN_LIBRARIES ${FANN_LIBRARIES} m )
    endif()
  
    if(FANN_INCLUDE_DIRS AND FANN_LIBRARIES)
       set(FANN_FOUND TRUE)
    endif()
  
    if(FANN_FOUND)
      if(NOT FANN_FIND_QUIETLY)
        message(STATUS "Found FANN:")
        message(STATUS "FANN_INCLUDE_DIRS: ${FANN_INCLUDE_DIRS}")
        message(STATUS "FANN_LIBRARIES: ${FANN_LIBRARIES}")
      endif()
    else()
      if(FANN_FIND_REQUIRED)
        message(FATAL_ERROR "Could not find FANN")
      endif()
    endif()
  
    mark_as_advanced(FANN_INCLUDE_DIRS FANN_LIBRARIES)
  endif()