Skip to content

Commit 6def87f

Browse files
committed
check for metis.h
metis.h is not always installed in the same dir as parmetis.h
1 parent efe6e59 commit 6def87f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmake/FindParmetis.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ if(NOT EXISTS "${PARMETIS_INCLUDE_DIR}")
1212
message(FATAL_ERROR "parmetis include dir not found")
1313
endif()
1414

15+
find_path(METIS_INCLUDE_DIR metis.h PATHS "${PARMETIS_PREFIX}/include")
16+
if(NOT EXISTS "${METIS_INCLUDE_DIR}")
17+
message(FATAL_ERROR "metis include dir not found")
18+
endif()
19+
20+
1521
find_library(PARMETIS_LIBRARY parmetis PATHS "${PARMETIS_PREFIX}/lib")
1622
if(NOT EXISTS "${PARMETIS_LIBRARY}")
1723
message(FATAL_ERROR "parmetis library not found")
@@ -23,7 +29,7 @@ if(NOT EXISTS "${METIS_LIBRARY}")
2329
endif()
2430

2531
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY})
26-
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} )
32+
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${METIS_INCLUDE_DIR})
2733

2834
include(FindPackageHandleStandardArgs)
2935
# handle the QUIETLY and REQUIRED arguments and set PARMETIS_FOUND to TRUE

0 commit comments

Comments
 (0)