# Try to find the AMD library
#
-INCLUDE(FindPackageHandleStandardArgs)
+SET_IF_EMPTY(AMD_DIR "$ENV{AMD_DIR}")
+SET_IF_EMPTY(UMFPACK_DIR "$ENV{UMFPACK_DIR}")
FIND_PATH(AMD_INCLUDE_DIR amd.h
HINTS
- ${AMD_DIR}/include
- $ENV{AMD_DIR}/include
- ${UMFPACK_DIR}/include
- $ENV{UMFPACK_DIR}/include
+ ${AMD_DIR}
+ ${UMFPACK_DIR}
+ PATH_SUFFIXES
+ amd include Include AMD/Include ../AMD/Include
)
FIND_LIBRARY(AMD_LIBRARY
NAMES amd
HINTS
${AMD_DIR}
- $ENV{AMD_DIR}
${UMFPACK_DIR}
- $ENV{UMFPACK_DIR}
- PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
-)
+ PATH_SUFFIXES
+ lib${LIB_SUFFIX} lib64 lib Lib AMD/Lib ../AMD/Lib
+ )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AMD DEFAULT_MSG AMD_LIBRARY AMD_INCLUDE_DIR)
MARK_AS_ADVANCED(
AMD_LIBRARY
AMD_INCLUDE_DIR
+ AMD_DIR
)
+ELSE()
+ SET(AMD_DIR "" CACHE STRING
+ "An optional hint to an AMD directory"
+ )
ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
-#
-# To safe some logic, promote environment variables to cmake variables if
-# they are not already set.
-#
SET_IF_EMPTY(PETSC_DIR "$ENV{PETSC_DIR}")
SET_IF_EMPTY(PETSC_ARCH "$ENV{PETSC_ARCH}")
-
#
# Search for the first part of the includes:
#
# Try to find the UMFPACK library
#
-INCLUDE(FindPackageHandleStandardArgs)
+SET_IF_EMPTY(AMD_DIR "$ENV{AMD_DIR}")
+SET_IF_EMPTY(UMFPACK_DIR "$ENV{UMFPACK_DIR}")
FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h
HINTS
- ${UMFPACK_DIR}/include
- $ENV{UMFPACK_DIR}/include
- PATH_SUFFIXES umfpack
+ ${AMD_DIR}
+ ${UMFPACK_DIR}
+ PATH_SUFFIXES
+ umfpack include Include UMFPACK/Include ../UMFPACK/Include
)
FIND_LIBRARY(UMFPACK_LIBRARY
NAMES umfpack
HINTS
${UMFPACK_DIR}
- $ENV{UMFPACK_DIR}
- PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+ PATH_SUFFIXES
+ lib${LIB_SUFFIX} lib64 lib Lib UMFPACK/Lib ../UMFPACK/Lib
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG UMFPACK_LIBRARY UMFPACK_INCLUDE_DIR)
MARK_AS_ADVANCED(
UMFPACK_LIBRARY
UMFPACK_INCLUDE_DIR
+ UMFPACK_DIR
)
+ELSE()
+ SET(UMFPACK_DIR "" CACHE STRING
+ "An optional hint to an UMFPACK directory"
+ )
ENDIF()