Debian Codegraph @

cmake/modules/FindAMD.cmake

raw
1 # - Try to find AMD
2 # Once done this will define
3 #
4 # AMD_FOUND - system has AMD
5 # AMD_INCLUDE_DIRS - include directories for AMD
6 # AMD_LIBRARIES - libraries for AMD
7
8 #=============================================================================
9 # Copyright (C) 2010 Anders Logg
10 # All rights reserved.
11 #
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions
14 # are met:
15 #
16 # 1. Redistributions of source code must retain the above copyright
17 # notice, this list of conditions and the following disclaimer.
18 # 2. Redistributions in binary form must reproduce the above copyright
19 # notice, this list of conditions and the following disclaimer in
20 # the documentation and/or other materials provided with the
21 # distribution.
22 #
23 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 # POSSIBILITY OF SUCH DAMAGE.
35 #=============================================================================
36
37 message(STATUS "Checking for package 'AMD'")
38
39 # Check for header file
40 find_path(AMD_INCLUDE_DIRS amd.h
41 HINTS ${AMD_DIR}/include $ENV{AMD_DIR}/include ${PETSC_INCLUDE_DIRS} $ENV{PETSC_DIR}/include
42 PATH_SUFFIXES suitesparse ufsparse
43 DOC "Directory where the AMD header is located"
44 )
45 mark_as_advanced(AMD_INCLUDE_DIRS)
46
47 # Check for AMD library
48 find_library(AMD_LIBRARIES amd
49 HINTS ${AMD_DIR}/lib $ENV{AMD_DIR}/lib ${PETSC_LIBRARY_DIRS} $ENV{PETSC_DIR}/lib
50 DOC "The AMD library")
51 mark_as_advanced(AMD_LIBRARIES)
52
53 # Standard package handling
54 include(FindPackageHandleStandardArgs)
55 find_package_handle_standard_args(AMD
56 "AMD could not be found. Be sure to set AMD_DIR."
57 AMD_LIBRARIES AMD_INCLUDE_DIRS)