File: FindNetlib.cmake

package info (click to toggle)
visp 3.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 119,296 kB
  • sloc: cpp: 500,914; ansic: 52,904; xml: 22,642; python: 7,365; java: 4,247; sh: 482; makefile: 237; objc: 145
file content (146 lines) | stat: -rw-r--r-- 4,089 bytes parent folder | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#############################################################################
#
# ViSP, open source Visual Servoing Platform software.
# Copyright (C) 2005 - 2023 by Inria. All rights reserved.
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# See the file LICENSE.txt at the root directory of this source
# distribution for additional information about the GNU GPL.
#
# For using ViSP with software that can not be combined with the GNU
# GPL, please contact Inria about acquiring a ViSP Professional
# Edition License.
#
# See https://visp.inria.fr for more information.
#
# This software was developed at:
# Inria Rennes - Bretagne Atlantique
# Campus Universitaire de Beaulieu
# 35042 Rennes Cedex
# France
#
# If you have questions regarding the use of this file, please contact
# Inria at visp@inria.fr
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Description:
# Try to find Netlib Linear Algebra PACKage.
# Once run this will define:
#
# NETLIB_FOUND
# NETLIB_LIBRARIES
# NETLIB_VERSION
#
#############################################################################

set(NETLIB_FOUND FALSE)
set(NETLIB_LIBRARIES "")
set(NETLIB_VERSION "n/a")
if(WIN32)
  set(NETLIB_LIB_SEARCH_PATH
    $ENV{NETLIB_HOME}
    $ENV{NETLIB_DIR}
    $ENV{NETLIB_HOME}/lib
    $ENV{NETLIB_DIR}/lib
    $ENV{LAPACK_HOME}
    $ENV{LAPACK_DIR}
    $ENV{LAPACK_HOME}/lib
    $ENV{LAPACK_DIR}/lib
  )

  find_library(NETLIB_LIBRARY_NETLIB_RELEASE
    NAMES lapack
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_BLAS_RELEASE
    NAMES blas
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_F2C_RELEASE
    NAMES libf2c
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_NETLIB_DEBUG
    NAMES lapackd
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_BLAS_DEBUG
    NAMES blasd
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_F2C_DEBUG
    NAMES libf2cd
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  if((NETLIB_LIBRARY_NETLIB_RELEASE AND NETLIB_LIBRARY_BLAS_RELEASE AND NETLIB_LIBRARY_F2C_RELEASE))
    list(APPEND NETLIB_LIBRARIES optimized ${NETLIB_LIBRARY_NETLIB_RELEASE})
    list(APPEND NETLIB_LIBRARIES optimized ${NETLIB_LIBRARY_BLAS_RELEASE})
    list(APPEND NETLIB_LIBRARIES optimized ${NETLIB_LIBRARY_F2C_RELEASE})
    set(NETLIB_FOUND TRUE)
  endif()
  if((NETLIB_LIBRARY_NETLIB_DEBUG AND NETLIB_LIBRARY_BLAS_DEBUG AND NETLIB_LIBRARY_F2C_DEBUG))
    list(APPEND NETLIB_LIBRARIES debug ${NETLIB_LIBRARY_NETLIB_DEBUG})
    list(APPEND NETLIB_LIBRARIES debug ${NETLIB_LIBRARY_BLAS_DEBUG})
    list(APPEND NETLIB_LIBRARIES debug ${NETLIB_LIBRARY_F2C_DEBUG})
    set(NETLIB_FOUND TRUE)
  endif()

else(WIN32)

  set(NETLIB_LIB_SEARCH_PATH
    $ENV{NETLIB_HOME}
    $ENV{NETLIB_DIR}
    $ENV{NETLIB_HOME}/lib
    $ENV{NETLIB_DIR}/lib
    $ENV{LAPACK_HOME}
    $ENV{LAPACK_DIR}
    $ENV{LAPACK_HOME}/lib
    $ENV{LAPACK_DIR}/lib
    /usr/lib
    /usr/lib64
    /usr/local/lib
    /usr/local/lib64
  )
  find_library(NETLIB_LIBRARY_LAPACK
    NAMES lapack
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  find_library(NETLIB_LIBRARY_BLAS
    NAMES blas
    PATHS ${NETLIB_LIB_SEARCH_PATH}
  )

  if((NETLIB_LIBRARY_LAPACK AND NETLIB_LIBRARY_BLAS))
    set(NETLIB_LIBRARIES ${NETLIB_LIBRARY_LAPACK} ${NETLIB_LIBRARY_BLAS})
    set(NETLIB_FOUND TRUE)

    get_filename_component(NETLIB_LIB_DIR ${NETLIB_LIBRARY_LAPACK} PATH)
    vp_get_version_from_pkg("lapack" "${NETLIB_LIB_DIR}/pkgconfig" NETLIB_VERSION)

  endif()
endif(WIN32)

mark_as_advanced(
  NETLIB_LIBRARIES
  NETLIB_LIBRARY_LAPACK
  NETLIB_LIBRARY_BLAS
  NETLIB_LIBRARY_NETLIB_RELEASE
  NETLIB_LIBRARY_BLAS_RELEASE
  NETLIB_LIBRARY_NETLIB_DEBUG
  NETLIB_LIBRARY_BLAS_DEBUG
  NETLIB_LIBRARY_F2C_DEBUG
  NETLIB_LIBRARY_F2C_RELEASE
)