Commit 5f243faa authored by David Bommes's avatar David Bommes

some cmake-Finder upgrades to support Fedora and to be more clean

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14404 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f1197408
......@@ -28,8 +28,8 @@ if( WIN32 )
else (WIN32)
FIND_LIBRARY( ANN_LIBRARY
NAMES ann
PATHS /lib /usr/lib /usr/local/lib )
NAMES ann ANN
PATHS /lib /usr/lib /usr/lib64 /usr/local/lib )
endif( WIN32)
......
......@@ -4,11 +4,13 @@
# ARPACK_FOUND - system has ARPACK
# ARPACK_INCLUDE_DIR - the ARPACK include directories
# ARPACK_LIBRARY - Link this to use ARPACK
# ARPACKpp_LIBRARY - Link this to use ARPACK++
# ARPACK_LIBRARIES - Link this to use ARPACK together with ARPACK++
find_path (ARPACK_INCLUDE_DIR NAMES arpack++/argeig.h
HINTS ENV ARPACK_INCLUDE_DIR
PATHS /usr/include/arpack++ "C:\\libs\\arpack++\\include"
PATHS /usr/include/arpack++ $ENV{HOME}/opt/arpack++/include "C:\\libs\\arpack++\\include"
DOC "ARPACK Include Directory")
IF ( WIN32 )
......@@ -16,9 +18,18 @@ find_library( ARPACK_LIBRARY arpack.lib
PATHS "C:\\libs\\arpack++\\lib"
)
ELSE( WIN32 )
find_library( ARPACK_LIBRARY arpack arpack++
PATHS /usr/lib
find_library( ARPACK_LIBRARY arpack
PATHS /usr/lib /usr/lib64
)
find_library( ARPACKpp_LIBRARY arpack++
PATHS /usr/lib /usr/lib64
)
list( APPEND ARPACK_LIBRARIES ${ARPACK_LIBRARY} )
IF(ARPACKpp_LIBRARY)
list( APPEND ARPACK_LIBRARIES ${ARPACKpp_LIBRARY} )
ENDIF(ARPACKpp_LIBRARY)
ENDIF( WIN32 )
IF (ARPACK_INCLUDE_DIR AND ARPACK_LIBRARY)
......
......@@ -14,7 +14,8 @@ GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
IF (NOT APPLE )
# Look for the header file.
FIND_PATH(CGAL_INCLUDE_DIR NAMES CGAL/auto_link/auto_link.h
PATHS ../../External/include
PATHS /usr/include
../../External/include
"C:/libs/CGAL-3.6/include"
"C:/Program Files/CGAL-3.5/include"
"C:/Programme/CGAL-3.5/include"
......@@ -68,7 +69,7 @@ IF(CGAL_INCLUDE_DIR )
ELSE( WIN32 )
find_path(CGAL_LIBRARY_DIR
NAMES "libCGAL.so"
PATHS "/usr/lib/"
PATHS "/usr/lib/" "/usr/lib64"
DOC "Directory containing the CGAL library"
)
list ( APPEND CGAL_LIBRARIES CGAL CGAL_Core CGAL_ImageIO CGAL_Qt4)
......
......@@ -37,6 +37,20 @@ if ( COMISO_INCLUDE_DIR )
endif()
STRING(REGEX MATCH "\#define COMISO_SUITESPARSE_AVAILABLE 1" COMISO_SUITESPARSE_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_SUITESPARSE_BUILD_TIME_AVAILABLE )
find_package(SUITESPARSE)
if ( NOT SUITESPARSE_FOUND )
message(ERROR "COMISO configured with Suitesparse but Suitesparse not available")
endif()
list (APPEND COMISO_OPT_DEPS "SUITESPARSE")
endif()
STRING(REGEX MATCH "\#define COMISO_PETSC_AVAILABLE 1" COMISO_PETSC_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_PETSC_BUILD_TIME_AVAILABLE )
......@@ -65,6 +79,20 @@ if ( COMISO_INCLUDE_DIR )
endif()
STRING(REGEX MATCH "\#define COMISO_METIS_AVAILABLE 1" COMISO_METIS_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_METIS_BUILD_TIME_AVAILABLE )
find_package(METIS)
if ( NOT METIS_FOUND )
message(ERROR "COMISO configured with Metis but Metis not available")
endif()
list (APPEND COMISO_OPT_DEPS "METIS")
endif()
STRING(REGEX MATCH "\#define COMISO_MUMPS_AVAILABLE 1" COMISO_MUMPS_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_MUMPS_BUILD_TIME_AVAILABLE )
......@@ -121,6 +149,34 @@ if ( COMISO_INCLUDE_DIR )
endif()
STRING(REGEX MATCH "\#define COMISO_ARPACK_AVAILABLE 1" COMISO_ARPACK_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_ARPACK_BUILD_TIME_AVAILABLE )
find_package(ARPACK)
if ( NOT ARPACK_FOUND )
message(ERROR "COMISO configured with ARPACK but ARPACK not available")
endif()
list (APPEND COMISO_OPT_DEPS "ARPACK")
endif()
STRING(REGEX MATCH "\#define COMISO_CPLEX_AVAILABLE 1" COMISO_CPLEX_BUILD_TIME_AVAILABLE ${CURRENT_COMISO_CONFIG} )
if ( COMISO_CPLEX_BUILD_TIME_AVAILABLE )
find_package(CPLEX)
if ( NOT CPLEX_FOUND )
message(ERROR "COMISO configured with CPLEX but CPLEX not available")
endif()
list (APPEND COMISO_OPT_DEPS "CPLEX")
endif()
add_definitions (-DCOMISODLL -DUSECOMISO )
endif(COMISO_INCLUDE_DIR)
......
......@@ -16,9 +16,8 @@ FIND_PATH(Eigen3_INCLUDE_DIR NAMES Eigen/Dense
PATHS /usr/include/eigen3
/usr/local/include
"c:\\libs\\eigen3\\include"
"c:\\libs\\eigen\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
/opt/local/include/eigen3
"c:\\libs\\eigen\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
../../External/include
${module_file_path}/../../../External/include)
......
# - Try to find IPOPT
# Once done this will define
# IPOPT_FOUND - System has IpOpt
# IPOPT_INCLUDE_DIRS - The IpOpt include directories
# IPOPT_LIBRARY_DIRS - The library directories needed to use IpOpt
# IPOPT_LIBRARIES - The libraries needed to use IpOpt
if (IPOPT_INCLUDE_DIR)
# in cache already
SET(IPOPT_FIND_QUIETLY TRUE)
......@@ -42,36 +50,41 @@ ELSEIF(APPLE)
ELSE( WIN32 )
find_path(IPOPT_INCLUDE_DIR NAMES IpNLP.hpp
PATHS "/usr/include/coin"
${IPOPT_INCLUDE_PATH}
PATHS "$ENV{IPOPT_HOME}/include/coin"
"/usr/include/coin"
)
# MESSAGE(STATUS "$ENV{IPOPT_HOME}/include")
IF(IPOPT_INCLUDE_DIR)
SET(IPOPT_FOUND TRUE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
#wrong config under Debian workaround
add_definitions( -DHAVE_CSTDDEF )
# SET(IPOPT_LIBRARY_DIR "$ENV{IPOPT_DIR}/lib/$ENV{IPOPT_ARCH}/" CACHE PATH "Path to IPOPT Library")
# SET(IPOPT_LIBRARY "tao;taopetsc;taofortran" CACHE STRING "IPOPT Libraries")
# MESSAGE(STATUS "${IPOPT_LIBRARY_DIR}")
# MESSAGE(STATUS "${IPOPT_LIBRARY}")
ELSE(IPOPT_INCLUDE_DIR)
SET(IPOPT_FOUND FALSE)
SET(IPOPT_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
ENDIF(IPOPT_INCLUDE_DIR)
find_library( IPOPT_LIBRARY
ipopt
PATHS "/usr/lib" )
PATHS "$ENV{IPOPT_HOME}/lib"
"/usr/lib" )
#wrong config under Debian workaround
add_definitions( -DHAVE_CSTDDEF )
# set optional path to HSL Solver
find_path(IPOPT_HSL_LIBRARY_DIR NAMES libhsl.so
PATHS "$ENV{HOME}/opt/HSL/lib"
PATHS "$ENV{IPOPT_HSL_LIBRARY_PATH}"
"$ENV{HOME}/opt/HSL/lib"
)
IF( IPOPT_HSL_LIBRARY_DIR)
set(IPOPT_LIBRARY_DIR ${IPOPT_HSL_LIBRARY_DIR})
ENDIF(IPOPT_HSL_LIBRARY_DIR)
set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}" )
set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}" )
set(IPOPT_LIBRARY_DIRS "${IPOPT_HSL_LIBRARY_DIR}")
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(IPOPT DEFAULT_MSG
IPOPT_LIBRARY IPOPT_INCLUDE_DIR)
mark_as_advanced(IPOPT_INCLUDE_DIR IPOPT_LIBRARY )
ENDIF()
# - Try to find MUMPS
# Once done this will define
# MUMPS_FOUND - System has Mumps
# MUMPS_INCLUDE_DIRS - The Mumps include directories
# MUMPS_LIBRARY_DIRS - The library directories needed to use Mumps
# MUMPS_LIBRARIES - The libraries needed to use Mumps
if (MUMPS_INCLUDE_DIR)
# in cache already
SET(MUMPS_FIND_QUIETLY TRUE)
endif (MUMPS_INCLUDE_DIR)
if (WIN32)
#TODO
ELSEIF(APPLE)
#TODO
ELSE( WIN32 )
find_path(MUMPS_INCLUDE_DIR NAMES dmumps_c.h
PATHS "/usr/include/"
find_path(MUMPS_INCLUDE_DIR NAMES dmumps_c.h
PATHS "$ENV{IPOPT_HOME}/ThirdParty/Mumps/MUMPS/include/"
"/usr/include/"
)
find_library( MUMPS_LIBRARY
dmumps coinmumps
PATHS "$ENV{IPOPT_HOME}/lib/"
"/usr/lib" )
set(MUMPS_INCLUDE_DIRS "${MUMPS_INCLUDE_DIR}" )
set(MUMPS_LIBRARIES "${MUMPS_LIBRARY}" )
IF(MUMPS_INCLUDE_DIR)
SET(MUMPS_FOUND TRUE)
SET(MUMPS_INCLUDE_DIR ${MUMPS_INCLUDE_DIR})
ELSE(MUMPS_INCLUDE_DIR)
SET(MUMPS_FOUND FALSE)
SET(MUMPS_INCLUDE_DIR ${IPOPT_INCLUDE_DIR})
ENDIF(MUMPS_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(MUMPS DEFAULT_MSG
MUMPS_LIBRARY MUMPS_INCLUDE_DIR)
find_library( MUMPS_LIBRARY
dmumps
PATHS "/usr/lib" )
ENDIF()
mark_as_advanced(MUMPS_INCLUDE_DIR MUMPS_LIBRARY )
\ No newline at end of file
......@@ -8,7 +8,7 @@
# SUITESPARSE_SPQR_LIBRARY_DIR - name of spqr library (necessary due to error in debian package)
# SUITESPARSE_LIBRARY_DIR - Library main directory containing suitesparse libs
# SUITESPARSE_LIBRARY_DIRS - all Library directories containing suitesparse libs
#
# SUITESPARSE_SPQR_VALID - automatic identification whether or not spqr package is installed correctly
IF (SUITESPARSE_INCLUDE_DIRS)
# Already in cache, be silent
......@@ -38,11 +38,11 @@ if( WIN32 )
ENDIF( SUITESPARSE_LIBRARY_DIRS )
else( WIN32 )
IF(APPLE)
IF( APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /opt/local/include/ufsparse )
FIND_PATH( SUITESPARSE_LIBRARY_DIR
FIND_PATH( SUITESPARSE_LIBRARY_DIRS
NAMES libcholmod.a
PATHS /opt/local/lib )
......@@ -51,15 +51,17 @@ else( WIN32 )
ELSE(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /usr/local/include
/usr/include
/usr/include/suitesparse/
${CMAKE_SOURCE_DIR}/MacOS/Libs/cholmod
/usr/include
/usr/include/suitesparse/
${CMAKE_SOURCE_DIR}/MacOS/Libs/cholmod
PATH_SUFFIXES cholmod/ CHOLMOD/ )
FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libcholmod.so
PATHS /usr/lib /usr/local/lib )
PATHS /usr/lib
/usr/lib64
/usr/local/lib )
ENDIF(APPLE)
......@@ -72,51 +74,42 @@ else( WIN32 )
# if we found the library, add it to the defined libraries
IF ( SUITESPARSE_LIBRARY_DIR )
FIND_LIBRARY( CHOLMOD_LIBRARY
NAMES cholmod CHOLMOD
PATHS ${SUITESPARSE_LIBRARY_DIR} )
FIND_LIBRARY( UMFPACK_LIBRARY
NAMES umfpack UMFPACK
list ( APPEND SUITESPARSE_LIBRARIES amd)
list ( APPEND SUITESPARSE_LIBRARIES btf)
list ( APPEND SUITESPARSE_LIBRARIES camd)
list ( APPEND SUITESPARSE_LIBRARIES ccolamd)
list ( APPEND SUITESPARSE_LIBRARIES cholmod)
list ( APPEND SUITESPARSE_LIBRARIES colamd)
# list ( APPEND SUITESPARSE_LIBRARIES csparse)
list ( APPEND SUITESPARSE_LIBRARIES cxsparse)
list ( APPEND SUITESPARSE_LIBRARIES klu)
# list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES umfpack)
# Metis and spqr are optional
FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY
NAMES metis
PATHS ${SUITESPARSE_LIBRARY_DIR} )
if ( NOT APPLE)
FIND_LIBRARY( SUITESPARSE_SPQR_LIBRARY
NAMES spqr SPQR
HINTS $ENV{HOME}/opt/SPQR/lib
PATHS ${SUITESPARSE_LIBRARY_DIR} )
FIND_PATH( SUITESPARSE_SPQR_LIBRARY_DIR
NAMES libspqr.so
PATHS /usr/lib /usr/local/lib $ENV{HOME}/opt/SPQR/lib)
IF (SUITESPARSE_METIS_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES metis)
ENDIF(SUITESPARSE_METIS_LIBRARY)
if(EXISTS "${CHOLMOD_INCLUDE_DIR}/SuiteSparseQR.hpp")
SET(SUITESPARSE_SPQR_VALID TRUE CACHE BOOL "SuiteSparseSPQR valid")
else()
FIND_LIBRARY( SUITESPARSE_SPQR_LIBRARY
NAMES libspqr.a
HINTS $ENV{HOME}/opt/SPQR/lib
PATHS ${SUITESPARSE_LIBRARY_DIR} )
FIND_PATH( SUITESPARSE_SPQR_LIBRARY_DIR
NAMES libspqr.a
PATHS ${SUITESPARSE_LIBRARY_DIR})
SET(SUITESPARSE_SPQR_VALID false CACHE BOOL "SuiteSparseSPQR valid")
endif()
if(SUITESPARSE_SPQR_VALID)
FIND_LIBRARY( SUITESPARSE_SPQR_LIBRARY
NAMES spqr
PATHS ${SUITESPARSE_LIBRARY_DIR} )
IF (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES spqr)
ENDIF (SUITESPARSE_SPQR_LIBRARY)
endif()
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_SPQR_LIBRARY_DIR} )
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
IF(APPLE)
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_LIBRARY_DIR}/libamd.a
${SUITESPARSE_LIBRARY_DIR}/libbtf.a
${SUITESPARSE_LIBRARY_DIR}/libcamd.a
${SUITESPARSE_LIBRARY_DIR}/libccolamd.a
${SUITESPARSE_LIBRARY_DIR}/libcolamd.a
${SUITESPARSE_LIBRARY_DIR}/libcsparse.a
${SUITESPARSE_LIBRARY_DIR}/libcxsparse.a
${SUITESPARSE_LIBRARY_DIR}/libklu.a
${SUITESPARSE_LIBRARY_DIR}/libspqr.a
${SUITESPARSE_LIBRARY_DIR}/libumfpack.a
${SUITESPARSE_LIBRARY_DIR}/libmetis.a
)
ENDIF(APPLE)
list ( APPEND SUITESPARSE_LIBRARIES ${CHOLMOD_LIBRARY} ${UMFPACK_LIBRARY} ${SUITESPARSE_SPQR_LIBRARY})
ENDIF( SUITESPARSE_LIBRARY_DIR )
ENDIF( SUITESPARSE_LIBRARY_DIR )
endif( WIN32 )
......
......@@ -37,15 +37,26 @@ find_path(TAO_INCLUDE_DIR NAMES "include/tao.h"
PATHS "$ENV{TAO_DIR}"
/usr/include/tao
)
# MESSAGE(STATUS "$ENV{TAO_HOME}/include")
IF(TAO_INCLUDE_DIR)
SET(TAO_FOUND TRUE)
SET(TAO_INCLUDE_DIRS "${TAO_INCLUDE_DIR}/include;${TAO_INCLUDE_DIR}")
SET(TAO_INCLUDE_DIR ${TAO_INCLUDE_DIR}/include;${TAO_INCLUDE_DIR} CACHE PATH "Path to TAO Includes")
SET(TAO_LIBRARY_DIR "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/" CACHE PATH "Path to TAO Library")
SET(TAO_LIBRARY "tao;taopetsc;taofortran" CACHE STRING "TAO Libraries")
# MESSAGE(STATUS "${TAO_LIBRARY_DIR}")
#check VERSION 1.x or 2
IF(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/")
# MESSAGE(STATUS "TAO Version 1.x")
SET(TAO_LIBRARY_DIR "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/" CACHE PATH "Path to TAO Library")
SET(TAO_LIBRARY "tao;taopetsc;taofortran" CACHE STRING "TAO Libraries")
ELSE(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/") #VERSION 2
# MESSAGE(STATUS "TAO Version 2.x")
SET(TAO_LIBRARY_DIR "$ENV{TAO_DIR}/$ENV{PETSC_ARCH}/lib" CACHE PATH "Path to TAO Library")
SET(TAO_LIBRARY "tao" CACHE STRING "TAO Libraries")
ENDIF(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/")
# MESSAGE(STATUS "${TAO_LIBRARY_DIR}")
# MESSAGE(STATUS "${TAO_LIBRARY}")
ELSE(TAO_INCLUDE_DIR)
SET(TAO_FOUND FALSE)
......
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