Commit a28382f2 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Improved PETSC finder.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18320 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fe9ef613
......@@ -15,28 +15,46 @@ ELSEIF (APPLE)
SET (PETSC_LIB_DBG "SuperLU")
ENDIF (WIN32)
FIND_PATH(PETSC_DIR NAMES include/${PETSC_HEADER}
PATHS
$ENV{PETSC_DIR}
/usr/lib/petscdir
)
FIND_PATH(PETSC_INCLUDE_DIR NAMES ${PETSC_HEADER}
PATHS
${PETSC_DIR}/include
${PETSC_INCLUDE_PATH}
/usr/local/include/petsc
/usr/local/include
/usr/include/petsc
/usr/include
"C:\\libs\\gurobi45"
${PETSC_DIR}/include
"${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
${PETSC_INCLUDE_PATH}
)
SET(PETSC_LIBRARY_DIR NOTFOUND CACHE PATH "The directory where the petsc library resides.")
SET(PETSC_ARCH $ENV{PETSC_ARCH} CACHE PATH "The PETSC architecture.")
FIND_PATH(PETSC_ARCH_INCLUDE_DIR NAMES petscconf.h
PATHS
${PETSC_DIR}/${PETSC_ARCH}/include
)
IF (EXISTS ${PETSC_DIR}/${PETSC_ARCH}/lib)
SET(PETSC_LIBRARY_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib
CACHE PATH "The directory where the petsc library resides.")
ELSE()
SET(PETSC_LIBRARY_DIR NOTFOUND
CACHE PATH "The directory where the petsc library resides.")
ENDIF()
FIND_LIBRARY( PETSC_LIBRARY_DEBUG
NAMES ${PETSC_LIB_DBG}
PATHS
HINTS
${PETSC_LIBRARY_DIR}
"${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
)
FIND_LIBRARY( PETSC_LIBRARY_RELEASE
NAMES ${PETSC_LIB_OPT}
PATHS
HINTS
${PETSC_LIBRARY_DIR}
"${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
)
......@@ -47,6 +65,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Petsc DEFAULT_MSG PETSC_LIBRARY_DEBUG PETSC_LI
IF (PETSC_FOUND)
SET(PETSC_LIBRARIES "${PETSC_LIBRARY}")
SET(PETSC_INCLUDE_DIRS "${PETSC_INCLUDE_DIR}")
IF (EXISTS ${PETSC_ARCH_INCLUDE_DIR})
LIST(APPEND PETSC_INCLUDE_DIRS "${PETSC_ARCH_INCLUDE_DIR}")
ENDIF()
SET( PETSC_LIBRARY
debug ${PETSC_LIBRARY_DEBUG}
optimized ${PETSC_LIBRARY_RELEASE} )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment