/usr/share/dune/cmake/modules/FindARPACK.cmake is in libdune-istl-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # .. cmake_module::
#
# Module that checks whether ARPACK is available and usable.
#
# Variables used by this module which you may want to set:
#
# :ref:`ARPACK_ROOT`
# Path list to search for ARPACK.
#
# Sets the following variables:
#
# :code:`ARPACK_FOUND`
# True if ARPACK available.
#
# :code:`ARPACK_LIBRARIES`
# Link against these libraries to use ARPACK.
#
# .. cmake_variable:: ARPACK_ROOT
#
# You may set this variable to have :ref:`FindARPACK` look
# for the ARPACK package in the given path before inspecting
# system paths.
#
# check for Fortran support which is required by ARPACK
if(NOT(Fortran_Works))
message(WARNING "Fortran doesn't seem to be supported, skipping search for ARPACK.")
# log errornous result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determing location of ARPACK failed:\n"
"Fortran support is required but could not be detected\n\n")
return()
endif()
# look for library, only at positions given by the user
find_library(ARPACK_LIBRARY
NAMES "arpack"
PATHS ${ARPACK_PREFIX} ${ARPACK_ROOT}
PATH_SUFFIXES "lib" "lib32" "lib64"
NO_DEFAULT_PATH
)
# look for library files, including default paths
find_library(ARPACK_LIBRARY
NAMES "arpack"
PATH_SUFFIXES "lib" "lib32" "lib64"
)
# check header usability
include(CMakePushCheckState)
cmake_push_check_state()
# we need if clauses here because variable is set variable-NOTFOUND if the
# searches above were not successful; without them CMake print errors like:
# "CMake Error: The following variables are used in this project, but they
# are set to NOTFOUND. Please set them or make sure they are set and tested
# correctly in the CMake files."
if(ARPACK_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ARPACK_LIBRARY})
endif()
# end of header usability check
cmake_pop_check_state()
# behave like a CMake module is supposed to behave
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
"ARPACK"
DEFAULT_MSG
ARPACK_LIBRARY
)
# hide the introduced cmake cached variables in cmake GUIs
mark_as_advanced(ARPACK_LIBRARY)
# if headers are found, store results
if(ARPACK_FOUND)
set(ARPACK_LIBRARIES ${ARPACK_LIBRARY})
# log result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determing location of ARPACK succeeded:\n"
"Libraries to link against: ${ARPACK_LIBRARIES}\n\n")
set(ARPACK_DUNE_LIBRARIES ${ARPACK_LIBRARIES}
CACHE STRING "Libraries used by DUNE when linking ARPACK programs")
else()
# log errornous result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determing location of ARPACK failed:\n"
"Libraries to link against: ${ARPACK_LIBRARIES}\n\n")
endif()
|