Commit 4c2b4bca authored by Max Lyon's avatar Max Lyon

remove some finders so that finders shipped with cmake are used

parent 75189b3a
This diff is collapsed.
# Try to find the GMP libraries
# GMP_FOUND - system has GMP lib
# GMP_INCLUDE_DIR - the GMP include directory
# GMP_LIBRARY_DIR - Directory where the GMP libraries are located
# GMP_LIBRARIES - the GMP libraries
# GMP_IN_CGAL_AUXILIARY - TRUE if the GMP found is the one distributed with CGAL in the auxiliary folder
# TODO: support MacOSX
include(CGAL_FindPackageHandleStandardArgs)
include(CGAL_GeneratorSpecificSettings)
# Is it already configured?
if (GMP_INCLUDE_DIR AND GMP_LIBRARY_DIR )
set(GMP_FOUND TRUE)
else()
find_package(CGAL)
if (NOT CGAL_FOUND)
message(STATUS "CGAL not found .. required to use taucs!")
set(GMP_FOUND FALSE)
else ()
find_path(GMP_INCLUDE_DIR
NAMES gmp.h
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/include"
DOC "The directory containing the GMP header files"
)
if ( GMP_INCLUDE_DIR STREQUAL "${CMAKE_SOURCE_DIR}/auxiliary/gmp/include" )
cache_set( GMP_IN_CGAL_AUXILIARY TRUE )
endif()
if ( CGAL_AUTO_LINK_ENABLED )
message("AAAA")
find_path(GMP_LIBRARY_DIR
NAMES "gmp-${CGAL_TOOLSET}-mt.lib" "gmp-${CGAL_TOOLSET}-mt-gd.lib" libgmp-10.lib
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/lib"
DOC "Directory containing the GMP library"
)
list ( APPEND GMP_LIBRARIES libgmp-10.lib;libmpfr-4.lib )
else()
find_library(GMP_LIBRARIES NAMES gmp
PATHS ENV GMP_LIB_DIR
DOC "Path to the GMP library"
)
if ( GMP_LIBRARIES )
get_filename_component(GMP_LIBRARY_DIR ${GMP_LIBRARIES} PATH CACHE )
endif()
endif()
# Attempt to load a user-defined configuration for GMP if couldn't be found
if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARY_DIR )
include( GMPConfig OPTIONAL )
endif()
find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_INCLUDE_DIR GMP_LIBRARY_DIR)
endif()
endif()
This diff is collapsed.
# Try to find the MPFR library
# See http://www.mpfr.org/
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(MPFR 2.3.0)
# to require version 2.3.0 to newer of MPFR.
#
# Once done this will define
#
# MPFR_FOUND - system has MPFR lib with correct version
# MPFR_INCLUDES - the MPFR include directory
# MPFR_LIBRARIES - the MPFR library
# MPFR_VERSION - MPFR version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2010 Jitse Niesen, <jitse@maths.leeds.ac.uk>
# Redistribution and use is allowed according to the terms of the BSD license.
# Set MPFR_INCLUDES
find_package(CGAL)
find_path(MPFR_INCLUDES
NAMES
mpfr.h
PATHS
$ENV{GMPDIR}
${INCLUDE_INSTALL_DIR}
${CGAL_INCLUDE_DIR}/../auxiliary/gmp/include
)
# Set MPFR_FIND_VERSION to 1.0.0 if no minimum version is specified
if(NOT MPFR_FIND_VERSION)
if(NOT MPFR_FIND_VERSION_MAJOR)
set(MPFR_FIND_VERSION_MAJOR 1)
endif(NOT MPFR_FIND_VERSION_MAJOR)
if(NOT MPFR_FIND_VERSION_MINOR)
set(MPFR_FIND_VERSION_MINOR 0)
endif(NOT MPFR_FIND_VERSION_MINOR)
if(NOT MPFR_FIND_VERSION_PATCH)
set(MPFR_FIND_VERSION_PATCH 0)
endif(NOT MPFR_FIND_VERSION_PATCH)
set(MPFR_FIND_VERSION "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}")
endif(NOT MPFR_FIND_VERSION)
if(MPFR_INCLUDES)
# Set MPFR_VERSION
file(READ "${MPFR_INCLUDES}/mpfr.h" _mpfr_version_header)
string(REGEX MATCH "define[ \t]+MPFR_VERSION_MAJOR[ \t]+([0-9]+)" _mpfr_major_version_match "${_mpfr_version_header}")
set(MPFR_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+MPFR_VERSION_MINOR[ \t]+([0-9]+)" _mpfr_minor_version_match "${_mpfr_version_header}")
set(MPFR_MINOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+MPFR_VERSION_PATCHLEVEL[ \t]+([0-9]+)" _mpfr_patchlevel_version_match "${_mpfr_version_header}")
set(MPFR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}")
set(MPFR_VERSION ${MPFR_MAJOR_VERSION}.${MPFR_MINOR_VERSION}.${MPFR_PATCHLEVEL_VERSION})
# Check whether found version exceeds minimum version
if(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
set(MPFR_VERSION_OK FALSE)
message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDES}, "
"but at least version ${MPFR_FIND_VERSION} is required")
else(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
set(MPFR_VERSION_OK TRUE)
endif(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
endif(MPFR_INCLUDES)
# Set MPFR_LIBRARIES
find_library(MPFR_LIBRARIES mpfr libmpfr-4 PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR} ${CGAL_INCLUDE_DIR}/../auxiliary/gmp/lib)
# Epilogue
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MPFR DEFAULT_MSG
MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK)
mark_as_advanced(MPFR_INCLUDES MPFR_LIBRARIES)
# - Find TAUCS
# Find the native TAUCS headers and libraries.
#
# TAUCS_INCLUDE_DIR - where to find TAUCS.h, etc.
# TAUCS_LIBRARY - List of libraries when using TAUCS.
# TAUCS_FOUND - True if TAUCS found.
IF (TAUCS_INCLUDE_DIR)
# Already in cache, be silent
SET(TAUCS_FIND_QUIETLY TRUE)
ENDIF (TAUCS_INCLUDE_DIR)
# Look for the header file.
IF(WIN32)
find_package(CGAL)
if (NOT CGAL_FOUND)
message(STATUS "CGAL not found .. required to use taucs!")
endif()
FIND_PATH(TAUCS_INCLUDE_DIR NAMES taucs.h
PATHS "${CGAL_TAUCS_DIR}/include" )
ELSE(WIN32)
IF(APPLE)
FIND_PATH(TAUCS_INCLUDE_DIR NAMES taucs.h
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/taucs/src"
~/sw/taucs/include
)
ELSE (APPLE)
FIND_PATH(TAUCS_INCLUDE_DIR NAMES taucs.h
PATHS /ACG/acgdev/gcc-4.3-x86_64/taucs-2.2-gfortran/include
)
ENDIF(APPLE)
ENDIF(WIN32)
# Copy the results to the output variables.
IF(TAUCS_INCLUDE_DIR )
SET(TAUCS_FOUND 1)
SET(TAUCS_INCLUDE_DIR ${TAUCS_INCLUDE_DIR})
IF(WIN32)
# find_package(CGAL)
SET(TAUCS_LIBRARY "${CGAL_TAUCS_DIR}/lib/libtaucs.lib" )
ELSE(WIN32)
IF(APPLE)
FIND_LIBRARY( TAUCS_LIBRARY
NAMES taucs
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/taucs/lib/darwin9.0"
~/sw/taucs/lib/darwin11
)
ELSE (APPLE)
FIND_LIBRARY( TAUCS_LIBRARY
NAMES taucs
PATHS /ACG/acgdev/gcc-4.3-x86_64/taucs-2.2.new/lib
)
ENDIF( APPLE)
ENDIF(WIN32)
ELSE(TAUCS_INCLUDE_DIR )
SET(TAUCS_FOUND 0)
SET(TAUCS_INCLUDE_DIR)
ENDIF(TAUCS_INCLUDE_DIR )
# Report the results.
IF(NOT TAUCS_FOUND)
SET(TAUCS_DIR_MESSAGE
"TAUCS was not found. Make sure TAUCS_INCLUDE_DIR is set to the directories containing the include and lib files for TAUCS. .")
IF(TAUCS_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${TAUCS_DIR_MESSAGE}")
ELSEIF(NOT TAUCS_FIND_QUIETLY)
MESSAGE(STATUS "${TAUCS_DIR_MESSAGE}")
ELSE(NOT TAUCS_FIND_QUIETLY)
ENDIF(TAUCS_FIND_REQUIRED)
ELSE (NOT TAUCS_FOUND)
IF(NOT TAUCS_FIND_QUIETLY)
MESSAGE(STATUS "Looking for TAUCS - found")
ENDIF(NOT TAUCS_FIND_QUIETLY)
IF ( NOT WIN32 )
SET(TAUCS_LIBRARY "${TAUCS_LIBRARY};metis")
ELSE ( NOT WIN32 )
SET(TAUCS_LIBRARY "${TAUCS_LIBRARY}")
ENDIF( NOT WIN32 )
ENDIF(NOT TAUCS_FOUND)
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