Skip to content
Snippets Groups Projects
Commit b0a83173 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

add USE_LIS option and FindLis

parent 5e9332ba
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,9 @@ OPTION(OGS_BUILD_UTILS "Should the utilities programms be built?" OFF) ...@@ -55,6 +55,9 @@ OPTION(OGS_BUILD_UTILS "Should the utilities programms be built?" OFF)
OPTION(OGS_NO_EXTERNAL_LIBS "Builds OGS without any external dependencies." OFF) OPTION(OGS_NO_EXTERNAL_LIBS "Builds OGS without any external dependencies." OFF)
# Linear solvers
OPTION(OGS_USE_LIS "Use Lis" OFF)
# Logging # Logging
OPTION(OGS_DISABLE_LOGGING "Disables all logog messages." OFF) OPTION(OGS_DISABLE_LOGGING "Disables all logog messages." OFF)
......
...@@ -138,6 +138,15 @@ IF(Shapelib_FOUND) ...@@ -138,6 +138,15 @@ IF(Shapelib_FOUND)
ADD_DEFINITIONS(-DShapelib_FOUND) ADD_DEFINITIONS(-DShapelib_FOUND)
ENDIF() # Shapelib_FOUND ENDIF() # Shapelib_FOUND
## lis ##
IF(OGS_USE_LIS)
FIND_PACKAGE ( LIS REQUIRED )
IF (LIS_FOUND)
INCLUDE_DIRECTORIES( ${LIS_INCLUDE_DIR} )
ADD_DEFINITIONS(-DUSE_LIS)
ENDIF()
ENDIF()
######################## ########################
### Find other stuff ### ### Find other stuff ###
######################## ########################
......
# - Try to find LIS
# Once done, this will define
#
# LIS_FOUND
# LIS_INCLUDE_DIRS
# LIS_LIBRARIES
if (NOT LIS_FOUND)
include(LibFindMacros)
find_path( LIS_INCLUDE_DIR
NAMES lis.h
PATHS ${CMAKE_SOURCE_DIR}/../Libs/precompiled)
if ( UNIX )
# Tell if the unix system is on 64-bit base
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
find_library(LIS_LIBRARIES
NAMES lis-64
PATHS ${CMAKE_SOURCE_DIR}/../Libs/precompiled )
else (CMAKE_SIZEOF_VOID_P MATCHES "8")
find_library(LIS_LIBRARIES
NAMES lis-32
PATHS ${CMAKE_SOURCE_DIR}/../Libs/precompiled )
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
else ( UNIX )
find_library(LIS_LIBRARIES
NAMES lisomp
PATHS ${CMAKE_SOURCE_DIR}/../Libs/precompiled )
endif ( UNIX )
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
if (NOT LIS_LIBRARIES STREQUAL "LIS_LIBRARIES-NOTFOUND" AND NOT LIS_INCLUDE_DIR STREQUAL "LIS_INCLUDE_DIR-NOTFOUND")
set(LIS_PROCESS_INCLUDES LIS_INCLUDE_DIR)
set(LIS_PROCESS_LIBS LIS_LIBRARIES)
libfind_process(LIS)
else (NOT LIS_LIBRARIES STREQUAL "LIS_LIBRARIES-NOTFOUND" AND NOT LIS_INCLUDE_DIR STREQUAL "LIS_INCLUDE_DIR-NOTFOUND")
message (STATUS "Warning: LIS not found!")
endif (NOT LIS_LIBRARIES STREQUAL "LIS_LIBRARIES-NOTFOUND" AND NOT LIS_INCLUDE_DIR STREQUAL "LIS_INCLUDE_DIR-NOTFOUND")
endif (NOT LIS_FOUND)
if(LIS_FOUND)
INCLUDE_DIRECTORIES( ${LIS_INCLUDE_DIR} )
message(STATUS "LIS found (include: ${LIS_INCLUDE_DIR})")
endif(LIS_FOUND)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment