Commit c936b714 authored by Jan Möbius's avatar Jan Möbius
Browse files

dos2unix



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6481 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fe993d10
# - Find CGAL
# Find the CGAL autolinking headers.
#
# CGAL_INCLUDE_DIR - where to find CGAL.h, etc.
# CGAL_FOUND - True if CGAL found.
IF (CGAL_INCLUDE_DIR)
# Already in cache, be silent
SET(CGAL_FIND_QUIETLY TRUE)
ENDIF (CGAL_INCLUDE_DIR)
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
"C:/Program Files/CGAL-3.4/include"
"C:/Programme/CGAL-3.4/include"
"C:/libs/CGAL-3.4/include"
${module_file_path}/../../../External/include)
ELSE( NOT APPLE)
# Look for the header file.
FIND_PATH(CGAL_INCLUDE_DIR NAMES CGAL/auto_link/auto_link.h
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/CGAL-3.4/include"
)
ENDIF( NOT APPLE )
MARK_AS_ADVANCED(CGAL_INCLUDE_DIR)
# Copy the results to the output variables.
IF(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 1)
SET(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIR})
# Look for the taucs dir.
FIND_PATH(CGAL_TAUCS_DIR NAMES include/taucs.h
PATHS ${CGAL_INCLUDE_DIR}/../auxiliary/taucs)
IF(WIN32)
include(CGAL_GeneratorSpecificSettings)
find_path(CGAL_LIBRARY_DIR
NAMES "CGAL-${CGAL_TOOLSET}-mt.lib" "CGAL-${CGAL_TOOLSET}-mt-gd.lib"
PATHS "${CGAL_INCLUDE_DIR}/../lib"
DOC "Directory containing the CGAL library"
)
ENDIF(WIN32)
add_definitions (-DCGAL_AUTOLINK)
ELSE(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 0)
SET(CGAL_INCLUDE_DIR)
ENDIF(CGAL_INCLUDE_DIR )
# Report the results.
IF(NOT CGAL_FOUND)
SET(CGAL_DIR_MESSAGE
"CGAL was not found. Make sure CGAL_INCLUDE_DIR is set to the directories containing the include files for CGAL. .")
IF(CGAL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${CGAL_DIR_MESSAGE}")
ELSEIF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "${CGAL_DIR_MESSAGE}")
ELSE(NOT CGAL_FIND_QUIETLY)
ENDIF(CGAL_FIND_REQUIRED)
ELSE (NOT CGAL_FOUND)
IF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "Looking for CGAL - found")
ENDIF(NOT CGAL_FIND_QUIETLY)
ENDIF(NOT CGAL_FOUND)
# - Find CGAL
# Find the CGAL autolinking headers.
#
# CGAL_INCLUDE_DIR - where to find CGAL.h, etc.
# CGAL_FOUND - True if CGAL found.
IF (CGAL_INCLUDE_DIR)
# Already in cache, be silent
SET(CGAL_FIND_QUIETLY TRUE)
ENDIF (CGAL_INCLUDE_DIR)
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
"C:/Program Files/CGAL-3.4/include"
"C:/Programme/CGAL-3.4/include"
"C:/libs/CGAL-3.4/include"
${module_file_path}/../../../External/include)
ELSE( NOT APPLE)
# Look for the header file.
FIND_PATH(CGAL_INCLUDE_DIR NAMES CGAL/auto_link/auto_link.h
PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/CGAL-3.4/include"
)
ENDIF( NOT APPLE )
MARK_AS_ADVANCED(CGAL_INCLUDE_DIR)
# Copy the results to the output variables.
IF(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 1)
SET(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIR})
# Look for the taucs dir.
FIND_PATH(CGAL_TAUCS_DIR NAMES include/taucs.h
PATHS ${CGAL_INCLUDE_DIR}/../auxiliary/taucs)
IF(WIN32)
include(CGAL_GeneratorSpecificSettings)
find_path(CGAL_LIBRARY_DIR
NAMES "CGAL-${CGAL_TOOLSET}-mt.lib" "CGAL-${CGAL_TOOLSET}-mt-gd.lib"
PATHS "${CGAL_INCLUDE_DIR}/../lib"
DOC "Directory containing the CGAL library"
)
ENDIF(WIN32)
add_definitions (-DCGAL_AUTOLINK)
ELSE(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 0)
SET(CGAL_INCLUDE_DIR)
ENDIF(CGAL_INCLUDE_DIR )
# Report the results.
IF(NOT CGAL_FOUND)
SET(CGAL_DIR_MESSAGE
"CGAL was not found. Make sure CGAL_INCLUDE_DIR is set to the directories containing the include files for CGAL. .")
IF(CGAL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${CGAL_DIR_MESSAGE}")
ELSEIF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "${CGAL_DIR_MESSAGE}")
ELSE(NOT CGAL_FIND_QUIETLY)
ENDIF(CGAL_FIND_REQUIRED)
ELSE (NOT CGAL_FOUND)
IF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "Looking for CGAL - found")
ENDIF(NOT CGAL_FIND_QUIETLY)
ENDIF(NOT CGAL_FOUND)
# 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(FATAL_ERROR "CGAL not found .. required to use taucs!")
endif()
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 )
find_path(GMP_LIBRARY_DIR
NAMES "gmp-${CGAL_TOOLSET}-mt.lib" "gmp-${CGAL_TOOLSET}-mt-gd.lib"
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/lib"
DOC "Directory containing the GMP library"
)
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()
# 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(FATAL_ERROR "CGAL not found .. required to use taucs!")
endif()
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 )
find_path(GMP_LIBRARY_DIR
NAMES "gmp-${CGAL_TOOLSET}-mt.lib" "gmp-${CGAL_TOOLSET}-mt-gd.lib"
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/lib"
DOC "Directory containing the GMP library"
)
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()
# - Try to find PHYSIM
# Once done this will define
#
# PHYSIM_FOUND - system has PHYSIM
# PHYSIM_INCLUDE_DIR - the PHYSIM include directory
# PHYSIM_LIBRARY_DIR - where the libraries are
# PHYSIM_LIBRARY - Link these to use PHYSIM
#
IF (PHYSIM_INCLUDE_DIR)
# Already in cache, be silent
SET(PHYSIM_FIND_QUIETLY TRUE)
ENDIF (PHYSIM_INCLUDE_DIR)
FIND_PATH( PHYSIM_INCLUDE_DIR Config/PhySimDefines.hh
PATHS "${CMAKE_SOURCE_DIR}/PhySim" )
add_definitions (-DPHYSIMDLL -DUSEPHYSIM )
IF (PHYSIM_INCLUDE_DIR)
SET(PHYSIM_FOUND TRUE)
SET( PHYSIM_LIBRARY_DIR "${ACG_PROJECT_LIBDIR}" )
SET( PHYSIM_LIBRARY "PhySim")
ELSE (PHYSIM_INCLUDE_DIR)
SET( PHYSIM_FOUND FALSE )
SET( PHYSIM_LIBRARY_DIR )
ENDIF (PHYSIM_INCLUDE_DIR)
# - Try to find PHYSIM
# Once done this will define
#
# PHYSIM_FOUND - system has PHYSIM
# PHYSIM_INCLUDE_DIR - the PHYSIM include directory
# PHYSIM_LIBRARY_DIR - where the libraries are
# PHYSIM_LIBRARY - Link these to use PHYSIM
#
IF (PHYSIM_INCLUDE_DIR)
# Already in cache, be silent
SET(PHYSIM_FIND_QUIETLY TRUE)
ENDIF (PHYSIM_INCLUDE_DIR)
FIND_PATH( PHYSIM_INCLUDE_DIR Config/PhySimDefines.hh
PATHS "${CMAKE_SOURCE_DIR}/PhySim" )
add_definitions (-DPHYSIMDLL -DUSEPHYSIM )
IF (PHYSIM_INCLUDE_DIR)
SET(PHYSIM_FOUND TRUE)
SET( PHYSIM_LIBRARY_DIR "${ACG_PROJECT_LIBDIR}" )
SET( PHYSIM_LIBRARY "PhySim")
ELSE (PHYSIM_INCLUDE_DIR)
SET( PHYSIM_FOUND FALSE )
SET( PHYSIM_LIBRARY_DIR )
ENDIF (PHYSIM_INCLUDE_DIR)
# Find the Qwt 5.x includes and library, either the version linked to Qt3 or the version linked to Qt4
#
# On Windows it makes these assumptions:
# - the Qwt DLL is where the other DLLs for Qt are (QT_DIR\bin) or in the path
# - the Qwt .h files are in QT_DIR\include\Qwt or in the path
# - the Qwt .lib is where the other LIBs for Qt are (QT_DIR\lib) or in the path
#
# Qwt5_INCLUDE_DIR - where to find qwt.h if Qwt
# Qwt5_Qt4_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)
# Qwt5_Qt3_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)
# Qwt5_Qt4_FOUND - Qwt5 was found and uses Qt4
# Qwt5_Qt3_FOUND - Qwt5 was found and uses Qt3
# Qwt5_FOUND - Set to TRUE if Qwt5 was found (linked either to Qt3 or Qt4)
# Copyright (c) 2007, Pau Garcia i Quiles, <pgquiles@elpauer.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Condition is "(A OR B) AND C", CMake does not support parentheses but it evaluates left to right
IF(Qwt5_Qt4_LIBRARY OR Qwt5_Qt3_LIBRARY AND Qwt5_INCLUDE_DIR)
SET(Qwt5_FIND_QUIETLY TRUE)
ENDIF(Qwt5_Qt4_LIBRARY OR Qwt5_Qt3_LIBRARY AND Qwt5_INCLUDE_DIR)
IF(NOT QT4_FOUND)
FIND_PACKAGE( Qt4 REQUIRED QUIET )
ENDIF(NOT QT4_FOUND)
IF( QT4_FOUND )
# Is Qwt5 installed? Look for header files
FIND_PATH( Qwt5_INCLUDE_DIR qwt.h
PATHS ${QT_INCLUDE_DIR} /usr/local/qwt/include /usr/local/include /usr/include/qwt /usr/include c:\\Program\ Files\\qwt\\qwt-5.2.0 c:\\qwt-5.2.0
PATH_SUFFIXES qwt qwt5 qwt-qt4 qwt5-qt4 qwt-qt3 qwt5-qt3 include qwt/include qwt5/include qwt-qt4/include qwt5-qt4/include qwt-qt3/include qwt5-qt3/include ENV PATH)
# Find Qwt version
IF( Qwt5_INCLUDE_DIR )
FILE( READ ${Qwt5_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
STRING( REGEX MATCH "#define *QWT_VERSION *(0x05*)" QWT_IS_VERSION_5 ${QWT_GLOBAL_H})
IF( QWT_IS_VERSION_5 )
STRING(REGEX REPLACE ".*#define[\\t\\ ]+QWT_VERSION_STR[\\t\\ ]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" "\\1" Qwt_VERSION "${QWT_GLOBAL_H}")
# Find Qwt5 library linked to Qt4
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS /usr/local/qwt/lib /usr/local/lib /usr/lib c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib c:\\qwt-5.2.0
)
IF( UNIX AND NOT CYGWIN AND NOT APPLE)
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
#MESSAGE("Qwt5_Qt4_TENTATIVE_LIBRARY = ${Qwt5_Qt4_TENTATIVE_LIBRARY}")
EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
STRING( REGEX MATCH "QtCore" Qwt5_IS_LINKED_TO_Qt4 ${Qwt_Qt4_LIBRARIES_LINKED_TO})
IF( Qwt5_IS_LINKED_TO_Qt4 )
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt4_LIBRARY}" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_IS_LINKED_TO_Qt4 )
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ELSE( UNIX AND NOT CYGWIN AND NOT APPLE )
IF ( WIN32 )
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
# Assumes qwt.dll is in the Qt dir
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ENDIF( WIN32 )
IF ( APPLE )
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ENDIF( APPLE )
ENDIF( UNIX AND NOT CYGWIN AND NOT APPLE)
IF ( NOT APPLE )
# Find Qwt5 library linked to Qt3
FIND_LIBRARY( Qwt5_Qt3_TENTATIVE_LIBRARY NAMES qwt-qt3 qwt qwt5-qt3 qwt5 )
IF( UNIX AND NOT CYGWIN)
IF( Qwt5_Qt3_TENTATIVE_LIBRARY )
#MESSAGE("Qwt5_Qt3_TENTATIVE_LIBRARY = ${Qwt5_Qt3_TENTATIVE_LIBRARY}")
EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt3_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt-Qt3_LIBRARIES_LINKED_TO )
STRING( REGEX MATCH "qt-mt" Qwt5_IS_LINKED_TO_Qt3 ${Qwt-Qt3_LIBRARIES_LINKED_TO})
IF( Qwt5_IS_LINKED_TO_Qt3 )
SET( Qwt5_Qt3_LIBRARY ${Qwt5_Qt3_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt3 linked version of the qwt lib")
SET( Qwt5_Qt3_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt3" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_IS_LINKED_TO_Qt3 )
ENDIF( Qwt5_Qt3_TENTATIVE_LIBRARY )
ELSE( UNIX AND NOT CYGWIN)
SET( Qwt5_Qt3_LIBRARY ${Qwt5_Qt3_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt3 linked version of the qwt lib")
SET( Qwt5_Qt3_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt3_LIBRARY}" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( UNIX AND NOT CYGWIN )
ENDIF( NOT APPLE )
ENDIF( QWT_IS_VERSION_5 )
IF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
SET( Qwt5_FOUND TRUE )
ENDIF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
MARK_AS_ADVANCED( Qwt5_INCLUDE_DIR Qwt5_Qt4_LIBRARY Qwt5_Qt3_LIBRARY )
ENDIF( Qwt5_INCLUDE_DIR )
IF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Qwt 5.x")
ENDIF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
ENDIF( QT4_FOUND )
# Find the Qwt 5.x includes and library, either the version linked to Qt3 or the version linked to Qt4
#
# On Windows it makes these assumptions:
# - the Qwt DLL is where the other DLLs for Qt are (QT_DIR\bin) or in the path
# - the Qwt .h files are in QT_DIR\include\Qwt or in the path
# - the Qwt .lib is where the other LIBs for Qt are (QT_DIR\lib) or in the path
#
# Qwt5_INCLUDE_DIR - where to find qwt.h if Qwt
# Qwt5_Qt4_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)
# Qwt5_Qt3_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)
# Qwt5_Qt4_FOUND - Qwt5 was found and uses Qt4
# Qwt5_Qt3_FOUND - Qwt5 was found and uses Qt3
# Qwt5_FOUND - Set to TRUE if Qwt5 was found (linked either to Qt3 or Qt4)
# Copyright (c) 2007, Pau Garcia i Quiles, <pgquiles@elpauer.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Condition is "(A OR B) AND C", CMake does not support parentheses but it evaluates left to right
IF(Qwt5_Qt4_LIBRARY OR Qwt5_Qt3_LIBRARY AND Qwt5_INCLUDE_DIR)
SET(Qwt5_FIND_QUIETLY TRUE)
ENDIF(Qwt5_Qt4_LIBRARY OR Qwt5_Qt3_LIBRARY AND Qwt5_INCLUDE_DIR)
IF(NOT QT4_FOUND)
FIND_PACKAGE( Qt4 REQUIRED QUIET )
ENDIF(NOT QT4_FOUND)
IF( QT4_FOUND )
# Is Qwt5 installed? Look for header files
FIND_PATH( Qwt5_INCLUDE_DIR qwt.h
PATHS ${QT_INCLUDE_DIR} /usr/local/qwt/include /usr/local/include /usr/include/qwt /usr/include c:\\Program\ Files\\qwt\\qwt-5.2.0 c:\\qwt-5.2.0
PATH_SUFFIXES qwt qwt5 qwt-qt4 qwt5-qt4 qwt-qt3 qwt5-qt3 include qwt/include qwt5/include qwt-qt4/include qwt5-qt4/include qwt-qt3/include qwt5-qt3/include ENV PATH)
# Find Qwt version
IF( Qwt5_INCLUDE_DIR )
FILE( READ ${Qwt5_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
STRING( REGEX MATCH "#define *QWT_VERSION *(0x05*)" QWT_IS_VERSION_5 ${QWT_GLOBAL_H})
IF( QWT_IS_VERSION_5 )
STRING(REGEX REPLACE ".*#define[\\t\\ ]+QWT_VERSION_STR[\\t\\ ]+\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" "\\1" Qwt_VERSION "${QWT_GLOBAL_H}")
# Find Qwt5 library linked to Qt4
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS /usr/local/qwt/lib /usr/local/lib /usr/lib c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib c:\\qwt-5.2.0
)
IF( UNIX AND NOT CYGWIN AND NOT APPLE)
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
#MESSAGE("Qwt5_Qt4_TENTATIVE_LIBRARY = ${Qwt5_Qt4_TENTATIVE_LIBRARY}")
EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt4_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt_Qt4_LIBRARIES_LINKED_TO )
STRING( REGEX MATCH "QtCore" Qwt5_IS_LINKED_TO_Qt4 ${Qwt_Qt4_LIBRARIES_LINKED_TO})
IF( Qwt5_IS_LINKED_TO_Qt4 )
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt4_LIBRARY}" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_IS_LINKED_TO_Qt4 )
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ELSE( UNIX AND NOT CYGWIN AND NOT APPLE )
IF ( WIN32 )
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
# Assumes qwt.dll is in the Qt dir
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ENDIF( WIN32 )
IF ( APPLE )
IF( Qwt5_Qt4_TENTATIVE_LIBRARY )
SET( Qwt5_Qt4_LIBRARY ${Qwt5_Qt4_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt4 linked version of the qwt lib")
SET( Qwt5_Qt4_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt4" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_Qt4_TENTATIVE_LIBRARY )
ENDIF( APPLE )
ENDIF( UNIX AND NOT CYGWIN AND NOT APPLE)
IF ( NOT APPLE )
# Find Qwt5 library linked to Qt3
FIND_LIBRARY( Qwt5_Qt3_TENTATIVE_LIBRARY NAMES qwt-qt3 qwt qwt5-qt3 qwt5 )
IF( UNIX AND NOT CYGWIN)
IF( Qwt5_Qt3_TENTATIVE_LIBRARY )
#MESSAGE("Qwt5_Qt3_TENTATIVE_LIBRARY = ${Qwt5_Qt3_TENTATIVE_LIBRARY}")
EXECUTE_PROCESS( COMMAND "ldd" ${Qwt5_Qt3_TENTATIVE_LIBRARY} OUTPUT_VARIABLE Qwt-Qt3_LIBRARIES_LINKED_TO )
STRING( REGEX MATCH "qt-mt" Qwt5_IS_LINKED_TO_Qt3 ${Qwt-Qt3_LIBRARIES_LINKED_TO})
IF( Qwt5_IS_LINKED_TO_Qt3 )
SET( Qwt5_Qt3_LIBRARY ${Qwt5_Qt3_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt3 linked version of the qwt lib")
SET( Qwt5_Qt3_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt version ${Qwt_VERSION} linked to Qt3" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( Qwt5_IS_LINKED_TO_Qt3 )
ENDIF( Qwt5_Qt3_TENTATIVE_LIBRARY )
ELSE( UNIX AND NOT CYGWIN)
SET( Qwt5_Qt3_LIBRARY ${Qwt5_Qt3_TENTATIVE_LIBRARY} CACHE FILEPATH "Qt3 linked version of the qwt lib")
SET( Qwt5_Qt3_FOUND TRUE )
IF (NOT Qwt5_FIND_QUIETLY)
MESSAGE( STATUS "Found Qwt: ${Qwt5_Qt3_LIBRARY}" )
ENDIF (NOT Qwt5_FIND_QUIETLY)
ENDIF( UNIX AND NOT CYGWIN )
ENDIF( NOT APPLE )
ENDIF( QWT_IS_VERSION_5 )
IF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
SET( Qwt5_FOUND TRUE )
ENDIF( Qwt5_Qt4_FOUND OR Qwt5_Qt3_FOUND )
MARK_AS_ADVANCED( Qwt5_INCLUDE_DIR Qwt5_Qt4_LIBRARY Qwt5_Qt3_LIBRARY )
ENDIF( Qwt5_INCLUDE_DIR )
IF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Qwt 5.x")
ENDIF (NOT Qwt5_FOUND AND Qwt5_FIND_REQUIRED)
ENDIF( QT4_FOUND )
# - Try to find SLEPC
# Once done this will define
#
# SLEPC_FOUND - system has SLEPSc
# SLEPC_INCLUDE_DIR - the SLEPSc include directories
# SLEPC_LIBRARY - Link this to use SLEPSc
FIND_PACKAGE(PETSC)
find_path (SLEPC_INCLUDE_DIR slepc.h
HINTS ENV SLEPC_INCLUDE_DIR
PATHS /usr/lib/slepcdir/3.0.0/include "C:\\libs\\slepc-3.0.0-p4\\include"
DOC "SLEPC Include Directory")
IF ( WIN32 )
find_library( SLEPC_LIBRARY libslepc.lib
PATHS "C:\\libs\\slepc-3.0.0-p4\\cygwin-c-opt\\lib"
)
ELSE( WIN32 )
find_library( SLEPC_LIBRARY slepc
PATHS /usr/lib
)
ENDIF( WIN32 )
IF (SLEPC_INCLUDE_DIR AND SLEPC_LIBRARY)
SET(SLEPC_FOUND TRUE)
ELSE ()
SET(SLEPC_FOUND FALSE)
ENDIF ()
# - Try to find SLEPC
# Once done this will define
#
# SLEPC_FOUND - system has SLEPSc
# SLEPC_INCLUDE_DIR - the SLEPSc include directories
# SLEPC_LIBRARY - Link this to use SLEPSc
FIND_PACKAGE(PETSC)
find_path (SLEPC_INCLUDE_DIR slepc.h
HINTS ENV SLEPC_INCLUDE_DIR
PATHS /usr/lib/slepcdir/3.0.0/include "C:\\libs\\slepc-3.0.0-p4\\include"
DOC "SLEPC Include Directory")