File: Findmshr.cmake

package info (click to toggle)
mshr 2019.2.0~git20200924.c27eb18%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,216 kB
  • sloc: cpp: 9,814; python: 689; makefile: 295; sh: 65; ansic: 11
file content (51 lines) | stat: -rw-r--r-- 1,653 bytes parent folder | download | duplicates (3)
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
#.rst:
# Findmshr
# --------
#
# Find mshr library
#
# Find the mshr includes and library. This module defines
#
# ::
#
#   mshr_INCLUDE_DIRS, where to find mshr.h.
#   mshr_LIBRARIES, libraries to link against to use mshr
#   mshr_FOUND, If false (0), do not try to use mshr.
#
#
#
#
#
#=============================================================================
find_path(mshr_INCLUDE_DIR mshr.h
          DOC "The mshr include directory")

set(mshr_NAMES ${mshr_NAMES} libmshr${MSHR_LIB_NAME_EXT} mshr${MSHR_LIB_NAME_EXT})
find_library(mshr_LIBRARY NAMES ${mshr_NAMES}
            DOC "The mshr library")

# handle the QUIETLY and REQUIRED arguments and set mshr_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(mshr
                                  REQUIRED_VARS mshr_LIBRARY
                                                mshr_INCLUDE_DIR
                                  VERSION_VAR mshr_VERSION_STRING)

if(mshr_FOUND)
  # FIND_PACKAGE_HANDLE_STANDARD_ARGS sets mshr_FOUND to TRUE not 1
  # which interferes with the json in config.json (must be true not TRUE)
  # So set to 1 (following find_package(DOLFIN) )
  set( mshr_FOUND 1 )
  # use by setuptools.Extension, mshr_LIBRARIES must be in a form that appends to -l
  # i.e. mshr not libmshr.so
  set( mshr_LIBRARIES "mshr${MSHR_LIB_NAME_EXT}" )
  get_filename_component( mshr_LIBRARIES_DIRS ${mshr_LIBRARY} DIRECTORY )
  set( mshr_INCLUDE_DIRS ${mshr_INCLUDE_DIR} )
else()
  set( mshr_FOUND 0)
  set( mshr_LIBRARIES_DIRS "." )
  set( mshr_INCLUDE_DIRS "." )
endif()

mark_as_advanced(mshr_INCLUDE_DIR mshr_LIBRARY)