File: eigen_info.cmake

package info (click to toggle)
cppad 2026.00.00.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,588 kB
  • sloc: cpp: 112,960; sh: 6,146; ansic: 179; python: 71; sed: 12; makefile: 10
file content (45 lines) | stat: -rw-r--r-- 1,433 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
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2003-24 Bradley M. Bell
# ----------------------------------------------------------------------------
# eigen_info()
#
# cppad_has_eigen: (out)
# is 1 (0) if eigen is found (not found)
# If this is 1, the include directory for eigen will automatically be
# added using INCLUDE_DIRECTORIES with the SYSTEM flag.
#
# eigen_LINK_LIBRARIES: (out)
# if cppad_has_eigen is 1,
# is a list of absolute paths to libraries necessary to use eigen
# (should be empty because eigen is a header only library).
#
# This macro may use variables with the name eigen_*
MACRO(eigen_info)
   #
   # check for pkg-config
   IF( NOT PKG_CONFIG_FOUND )
      FIND_PACKAGE(PkgConfig REQUIRED)
   ENDIF( )
   #
   #
   IF( NOT ${use_cplusplus_2014_ok} )
      MESSAGE(STATUS "Eigen not supportedL: because c++14 not supported")
      SET(cppad_has_eigen 0)
   ELSE( )
      #
      # eigen_*
      pkg_check_modules(eigen QUIET eigen3 )
      #
      IF( eigen_FOUND )
         MESSAGE(STATUS "Eigen found")
         SET(cppad_has_eigen 1)
         INCLUDE_DIRECTORIES( SYSTEM ${eigen_INCLUDE_DIRS} )
      ELSE( )
         MESSAGE(STATUS "Eigen not Found: eigen3.pc not in PKG_CONFIG_PATH")
         SET(cppad_has_eigen 0)
      ENDIF( )
   ENDIF( )
   #
   print_variable( cppad_has_eigen )
ENDMACRO(eigen_info)