source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/cmake/FindMetis.cmake

Last change on this file was 136, checked in by ldecherf, 8 years ago

Doc

File size: 2.0 KB
Line 
1# Pastix requires METIS or METIS (partitioning and reordering tools)
2
3if (METIS_INCLUDES AND METIS_LIBRARIES)
4 set(METIS_FIND_QUIETLY TRUE)
5endif (METIS_INCLUDES AND METIS_LIBRARIES)
6
7find_path(METIS_INCLUDES
8 NAMES
9 metis.h
10 PATHS
11 $ENV{METISDIR}
12 ${INCLUDE_INSTALL_DIR}
13 PATH_SUFFIXES
14 .
15 metis
16 include
17)
18
19macro(_metis_check_version)
20 file(READ "${METIS_INCLUDES}/metis.h" _metis_version_header)
21
22 string(REGEX MATCH "define[ \t]+METIS_VER_MAJOR[ \t]+([0-9]+)" _metis_major_version_match "${_metis_version_header}")
23 set(METIS_MAJOR_VERSION "${CMAKE_MATCH_1}")
24 string(REGEX MATCH "define[ \t]+METIS_VER_MINOR[ \t]+([0-9]+)" _metis_minor_version_match "${_metis_version_header}")
25 set(METIS_MINOR_VERSION "${CMAKE_MATCH_1}")
26 string(REGEX MATCH "define[ \t]+METIS_VER_SUBMINOR[ \t]+([0-9]+)" _metis_subminor_version_match "${_metis_version_header}")
27 set(METIS_SUBMINOR_VERSION "${CMAKE_MATCH_1}")
28 if(NOT METIS_MAJOR_VERSION)
29 message(STATUS "Could not determine Metis version. Assuming version 4.0.0")
30 set(METIS_VERSION 4.0.0)
31 else()
32 set(METIS_VERSION ${METIS_MAJOR_VERSION}.${METIS_MINOR_VERSION}.${METIS_SUBMINOR_VERSION})
33 endif()
34 if(${METIS_VERSION} VERSION_LESS ${Metis_FIND_VERSION})
35 set(METIS_VERSION_OK FALSE)
36 else()
37 set(METIS_VERSION_OK TRUE)
38 endif()
39
40 if(NOT METIS_VERSION_OK)
41 message(STATUS "Metis version ${METIS_VERSION} found in ${METIS_INCLUDES}, "
42 "but at least version ${Metis_FIND_VERSION} is required")
43 endif(NOT METIS_VERSION_OK)
44endmacro(_metis_check_version)
45
46 if(METIS_INCLUDES AND Metis_FIND_VERSION)
47 _metis_check_version()
48 else()
49 set(METIS_VERSION_OK TRUE)
50 endif()
51
52
53find_library(METIS_LIBRARIES metis PATHS $ENV{METISDIR} ${LIB_INSTALL_DIR} PATH_SUFFIXES lib)
54
55include(FindPackageHandleStandardArgs)
56find_package_handle_standard_args(METIS DEFAULT_MSG
57 METIS_INCLUDES METIS_LIBRARIES METIS_VERSION_OK)
58
59mark_as_advanced(METIS_INCLUDES METIS_LIBRARIES)
Note: See TracBrowser for help on using the repository browser.