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

Rewrote Petsc finder.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18184 383ad7c9-94d9-4d36-a494-682f7c89f535
parent aefbadf3
if (PETSC_INCLUDE_DIRS) IF (PETSC_INCLUDE_DIRS)
# Already in cache, be silent # Already in cache, be silent
SET(PETSC_FIND_QUIETLY TRUE) SET(PETSC_FIND_QUIETLY TRUE)
endif(PETSC_INCLUDE_DIRS) ENDIF (PETSC_INCLUDE_DIRS)
if (WIN32) SET (PETSC_HEADER "petsc.h")
find_path(PETSC_INCLUDE_DIR NAMES petsc.h SET (PETSC_LIB_OPT "petsc")
PREFIXES SRC SET (PETSC_LIB_DBG "${PETSC_LIB_OPT}")
PATHS IF (WIN32)
"C:\\libs\\gurobi45" SET (PETSC_LIB_OPT "SuperLU")
${PETSC_DIR}/include SET (PETSC_LIB_DBG "SuperLUd")
) ELSEIF (APPLE)
SET (PETSC_HEADER "gurobi_c++.h")
find_library( PETSC_LIBRARY_RELEASE SET (PETSC_LIB_OPT "SuperLU")
SuperLU SET (PETSC_LIB_DBG "SuperLU")
PATHS "C:\\libs\\gurobi45\\lib" ) ENDIF (WIN32)
find_library( PETSC_LIBRARY_DEBUG
SuperLUd FIND_PATH(PETSC_INCLUDE_DIR NAMES ${PETSC_HEADER}
PATHS "C:\\libs\\gurobi45\\lib" ) PATHS
/usr/local/include/petsc
/usr/local/include
set ( PETSC_LIBRARY "optimized;${PETSC_LIBRARY_RELEASE};debug;${PETSC_LIBRARY_DEBUG}" CACHE STRING "PETSC Libraries" ) /usr/include/petsc
/usr/include
ELSEIF(APPLE) "C:\\libs\\gurobi45"
${PETSC_DIR}/include
find_path(PETSC_INCLUDE_DIR NAMES gurobi_c++.h "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40" ${PETSC_INCLUDE_PATH}
${PETSC_INCLUDE_PATH} )
)
SET(PETSC_LIBRARY_DIR NOTFOUND CACHE PATH "The directory where the petsc library resides.")
find_library( PETSC_LIBRARY FIND_LIBRARY( PETSC_LIBRARY_DEBUG
SuperLU NAMES ${PETSC_LIB_DBG}
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40") PATHS
${PETSC_LIBRARY_DIR}
ELSE( WIN32 ) "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
find_path(PETSC_INCLUDE_DIR1 NAMES petsc.h )
PATHS "$ENV{PETSC_DIR}/include" FIND_LIBRARY( PETSC_LIBRARY_RELEASE
${PETSC_INCLUDE_DIR1} NAMES ${PETSC_LIB_OPT}
) PATHS
${PETSC_LIBRARY_DIR}
find_path(PETSC_INCLUDE_DIR2 NAMES petscconf.h "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
PATHS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/include" )
${PETSC_INCLUDE_DIR2} INCLUDE (FindPackageHandleStandardArgs)
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Petsc DEFAULT_MSG PETSC_LIBRARY_DEBUG PETSC_LIBRARY_RELEASE PETSC_INCLUDE_DIR)
# MESSAGE(STATUS "$ENV{PETSC_HOME}/include")
IF(PETSC_INCLUDE_DIR1 AND PETSC_INCLUDE_DIR2) IF (PETSC_FOUND)
SET(PETSC_FOUND TRUE) SET(PETSC_LIBRARIES "${PETSC_LIBRARY}")
SET(PETSC_INCLUDE_DIRS "${PETSC_INCLUDE_DIR1};${PETSC_INCLUDE_DIR2}") SET(PETSC_INCLUDE_DIRS "${PETSC_INCLUDE_DIR}")
SET(PETSC_LIBRARY_DIR "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib" CACHE PATH "Path to PETSC Library") SET( PETSC_LIBRARY
SET(PETSC_LIBRARY "petsc" CACHE STRING "PETSC Libraries") debug ${PETSC_LIBRARY_DEBUG}
ELSE(PETSC_INCLUDE_DIR1 AND PETSC_INCLUDE_DIR2) release ${PETSC_LIBRARY_RELEASE} )
SET(PETSC_FOUND FALSE) ENDIF (PETSC_FOUND)
SET(PETSC_INCLUDE_DIR ${PETSC_INCLUDE_DIR})
ENDIF(PETSC_INCLUDE_DIR1 AND PETSC_INCLUDE_DIR2)
#find_library( PETSC_LIBRARY
# gurobi
# PATHS "${PETSC_HOME}/lib" )
ENDIF()
\ No newline at end of file
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