make the FindALUGrid module compatible with the OPM build system
This commit is contained in:
parent
55786cd290
commit
5d1353901e
@ -21,30 +21,30 @@ endmacro()
|
||||
|
||||
find_package(METIS)
|
||||
|
||||
if(ALUGRID_DIR)
|
||||
find_path(ALUGRID_PKGCONFIG_DIR alugrid.pc PATHS ${ALUGRID_DIR}
|
||||
if(ALUGRID_ROOT)
|
||||
find_path(ALUGRID_PKGCONFIG_DIR alugrid.pc PATHS ${ALUGRID_ROOT}
|
||||
PATH_SUFFIXES lib/pkgconfig/ alugrid/lib/pkgconfig
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_file(ALUGRID_VERSION alugridversion PATHS ${ALUGRID_DIR}/bin
|
||||
find_file(ALUGRID_VERSION alugridversion PATHS ${ALUGRID_ROOT}/bin
|
||||
NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_path(ALUGRID_PKGCONFIG_DIR alugrid.pc
|
||||
PATH_SUFFIXES lib/pkgconfig/ alugrid/lib/pkgconfig)
|
||||
|
||||
get_filename_component(_GUESSED_ALUGRID_DIR ${ALUGRID_PKGCONFIG_DIR}/../../ ABSOLUTE)
|
||||
find_file(ALUGRID_VERSION alugridversion PATHS ${_GUESSED_ALUGRID_DIR}/bin NO_DEFAULT_PATH)
|
||||
get_filename_component(_GUESSED_ALUGRID_ROOT ${ALUGRID_PKGCONFIG_DIR}/../../ ABSOLUTE)
|
||||
find_file(ALUGRID_VERSION alugridversion PATHS ${_GUESSED_ALUGRID_ROOT}/bin NO_DEFAULT_PATH)
|
||||
|
||||
if(ALUGRID_VERSION)
|
||||
set(ALUGRID_DIR ${_GUESSED_ALUGRID_DIR})
|
||||
set(ALUGRID_ROOT ${_GUESSED_ALUGRID_ROOT})
|
||||
else(ALUGRID_VERSION_PATH)
|
||||
get_filename_component(_GUESSED_ALUGRID_DIR ${ALUGRID_PKGCONFIG_DIR}/../../.. ABSOLUTE)
|
||||
get_filename_component(_GUESSED_ALUGRID_ROOT ${ALUGRID_PKGCONFIG_DIR}/../../.. ABSOLUTE)
|
||||
find_file(ALUGRID_VERSION alugridversion
|
||||
PATHS ${_GUESSED_ALUGRID_DIR}
|
||||
PATHS ${_GUESSED_ALUGRID_ROOT}
|
||||
PATH_SUFFIXES bin
|
||||
NO_DEFAULT_PATH)
|
||||
if(ALUGRID_VERSION)
|
||||
set(ALUGRID_DIR ${_GUESSED_ALUGRID_DIR})
|
||||
set(ALUGRID_ROOT ${_GUESSED_ALUGRID_ROOT})
|
||||
endif(ALUGRID_VERSION)
|
||||
endif(ALUGRID_VERSION)
|
||||
endif()
|
||||
@ -70,7 +70,7 @@ endif()
|
||||
unset(ALUGRID_VERSION CACHE)
|
||||
|
||||
find_path(ALUGRID_INCLUDE_DIR "alugrid_serial.h"
|
||||
PATHS "${ALUGRID_DIR}" PATH_SUFFIXES "include" "include/serial"
|
||||
PATHS "${ALUGRID_ROOT}" PATH_SUFFIXES "include" "include/serial"
|
||||
NO_DEFAULT_PATH DOC "Include path of serial alugrid headers.")
|
||||
if (NOT ALUGRID_INCLUDE_DIR)
|
||||
message(STATUS "Could not deterimine ALUGrid include directory")
|
||||
@ -79,26 +79,26 @@ if (NOT ALUGRID_INCLUDE_DIR)
|
||||
endif()
|
||||
mark_as_advanced(ALUGRID_INCLUDE_DIR)
|
||||
|
||||
find_library(ALUGRID_LIB alugrid
|
||||
PATHS "${ALUGRID_DIR}"
|
||||
find_library(ALUGRID_LIBRARIES alugrid
|
||||
PATHS "${ALUGRID_ROOT}"
|
||||
PATH_SUFFIXES lib lib32 lib64
|
||||
DOC "ALUGrid library"
|
||||
NO_DEFAULT_PATH)
|
||||
if (NOT ALUGRID_LIB)
|
||||
if (NOT ALUGRID_LIBRARIES)
|
||||
message(STATUS "Could not find ALUGrid usable library")
|
||||
_opm_set_alugrid(0)
|
||||
return()
|
||||
endif()
|
||||
mark_as_advanced(ALUGRID_LIB)
|
||||
mark_as_advanced(ALUGRID_LIBRARIES)
|
||||
|
||||
|
||||
set(ALUGRID_INCLUDES
|
||||
set(ALUGRID_INCLUDE_DIRS
|
||||
${ALUGRID_INCLUDE_DIR}
|
||||
${ALUGRID_INCLUDE_DIR}/serial
|
||||
${ALUGRID_INCLUDE_DIR}/duneinterface)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ALUGRID_INCLUDES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ALUGRID_LIB})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ALUGRID_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ALUGRID_LIBRARIES})
|
||||
check_include_file_cxx(stlheaders.h ALUGRID_SERIAL_FOUND)
|
||||
|
||||
if(ALUGRID_SERIAL_FOUND)
|
||||
@ -122,9 +122,9 @@ if(ALUGRID_PARALLEL_FOUND AND MPI_FOUND)
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if(ALUGRID_PARALLEL_INCLUDE_PATH)
|
||||
list(APPEND ALUGRID_INCLUDES ${ALUGRID_PARALLEL_INCLUDE_PATH})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ALUGRID_INCLUDES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ALUGRID_LIB})
|
||||
list(APPEND ALUGRID_INCLUDE_DIRS ${ALUGRID_PARALLEL_INCLUDE_PATH})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ALUGRID_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ALUGRID_LIBRARIES})
|
||||
#set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
|
||||
check_include_file_cxx(alugrid_parallel.h ALUGRID_PARALLEL_FOUND)
|
||||
unset(ALUGRID_PARALLEL_INCLUDE_PATH CACHE)
|
||||
|
Loading…
Reference in New Issue
Block a user