11# BLAS
2- option (BLAS_ROOT "Root directory of BLAS or OpenBLAS" " " )
2+ set (BLAS_ROOT "" CACHE STRING " Root directory of BLAS or OpenBLAS" )
33message (STATUS "BLAS_ROOT is " ${BLAS_ROOT} )
44
55if (WIN32 )
6-
76 find_package (OpenBLAS CONFIG REQUIRED)
87 message (STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR} " )
9-
108elseif (NOT APPLE )
119 # LINUX
1210 find_library (OPENBLAS_LIB
@@ -26,11 +24,10 @@ elseif(NOT APPLE)
2624 endif (NOT BLAS_LIB)
2725 message ("Found BLAS library at ${BLAS_LIB} " )
2826 endif (OPENBLAS_LIB)
29-
3027endif ()
3128
3229# METIS
33- option (METIS_ROOT "Root directory of METIS" " " )
30+ set (METIS_ROOT "" CACHE STRING " Root directory of METIS" )
3431message (STATUS "METIS_ROOT is " ${METIS_ROOT} )
3532
3633find_package (metis CONFIG)
@@ -53,4 +50,47 @@ else()
5350 NO_DEFAULT_PATH)
5451
5552 message ("Found Metis library at ${METIS_LIB} " )
53+ endif ()
54+
55+ # GKlib optional for newer versions on ubuntu and macos
56+ set (GKLIB_ROOT "" CACHE STRING "Root directory of GKlib" )
57+ if (NOT (GKLIB_ROOT STREQUAL "" ))
58+ message (STATUS "GKLIB_ROOT is " ${GKLIB_ROOT} )
59+
60+ find_package (GKlib CONFIG)
61+
62+ if (GKlib_FOUND)
63+ message (STATUS "gklib CMake config path: ${GKlib_DIR} " )
64+
65+ # get_cmake_property(_vars VARIABLES)
66+ # foreach(_v IN LISTS _vars)
67+ # if(_v MATCHES "GKlib")
68+ # message(STATUS "${_v} = ${${_v}}")
69+ # endif()
70+ # endforeach()
71+
72+ # get_property(_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY IMPORTED_TARGETS)
73+ # foreach(_t IN LISTS _targets)
74+ # if(_t MATCHES "GKlib")
75+ # message(STATUS "GKlib exported target: ${_t}")
76+ # endif()
77+ # endforeach()
78+
79+ else ()
80+ find_path (GKLIB_PATH
81+ NAMES "gklib.h"
82+ REQUIRED
83+ PATHS "${GKLIB_ROOT} /include"
84+ NO_DEFAULT_PATH)
85+
86+ message ("Found GKlib header at ${GKLIB_PATH} " )
87+
88+ find_library (GKLIB_LIB
89+ NAMES GKlib libGKlib
90+ REQUIRED
91+ PATHS "${GKLIB_ROOT} /lib"
92+ NO_DEFAULT_PATH)
93+
94+ message ("Found GKlib library at ${GKLIB_LIB} " )
95+ endif ()
5696endif ()
0 commit comments