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

dos2unix

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6954 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4713a7fa
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
# This macro is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
# it also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is found if all variables listed are TRUE.
# Example:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
# independent whether QUIET was used or not.
# If it is found, the location is reported using the VAR1 argument, so
# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
# If the second argument is DEFAULT_MSG, the message in the failure case will
# be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there.
macro(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
if("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
set(_FAIL_MESSAGE "Could NOT find ${_NAME}")
else()
set(_FAIL_MESSAGE "${_FAIL_MSG}")
endif()
string(TOUPPER ${_NAME} _NAME_UPPER)
set(${_NAME_UPPER}_FOUND TRUE)
if(NOT ${_VAR1})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
foreach(_CURRENT_VAR ${ARGN})
if(NOT ${_CURRENT_VAR})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
endforeach()
if (${_NAME_UPPER}_FOUND)
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "Found ${_NAME}: ${${_VAR1}}")
endif()
else()
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_FAIL_MESSAGE}")
else()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_FAIL_MESSAGE}")
endif()
endif()
endif()
endmacro()
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
# This macro is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
# it also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is found if all variables listed are TRUE.
# Example:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
# independent whether QUIET was used or not.
# If it is found, the location is reported using the VAR1 argument, so
# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
# If the second argument is DEFAULT_MSG, the message in the failure case will
# be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there.
macro(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
if("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
set(_FAIL_MESSAGE "Could NOT find ${_NAME}")
else()
set(_FAIL_MESSAGE "${_FAIL_MSG}")
endif()
string(TOUPPER ${_NAME} _NAME_UPPER)
set(${_NAME_UPPER}_FOUND TRUE)
if(NOT ${_VAR1})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
foreach(_CURRENT_VAR ${ARGN})
if(NOT ${_CURRENT_VAR})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
endforeach()
if (${_NAME_UPPER}_FOUND)
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "Found ${_NAME}: ${${_VAR1}}")
endif()
else()
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_FAIL_MESSAGE}")
else()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_FAIL_MESSAGE}")
endif()
endif()
endif()
endmacro()
# - Find FTGL
# Find the native FTGL headers and libraries.
#
# FTGL_INCLUDE_DIR - where to find FTGL.h, etc.
# FTGL_LIBRARIES - List of libraries when using FTGL.
# FTGL_FOUND - True if FTGL found.
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Look for the header file.
FIND_PATH(FTGL_INCLUDE_DIR NAMES FTGL/ftgl.h
PATHS /usr/include
/usr/local/include
../../External/include
"C:\\libs\\ftgl\\ftgl"
${module_file_path}/../../../External/include)
#MARK_AS_ADVANCED(FTGL_INCLUDE_DIR)
# Look for the library.
FIND_LIBRARY(FTGL_LIBRARY NAMES ftgl ftgl_dynamic_MTD
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
"C:\\libs\\ftgl\\msvc\\Build"
${module_file_path}/../../../External/lib)
#MARK_AS_ADVANCED(FTGL_LIBRARY)
IF( WIN32 AND PREFER_STATIC_LIBRARIES )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD )
IF( MSVC80 )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD_vc8 )
ELSEIF( MSVC90 )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD_vc9 )
ENDIF( MSVC80 )
FIND_LIBRARY( FTGL_STATIC_LIBRARY NAMES ${FTGL_STATIC_LIBRARY_NAME}
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
${module_file_path}/../../../External/lib )
MARK_AS_ADVANCED(FTGL_STATIC_LIBRARY)
FIND_LIBRARY( FTGL_STATIC_DEBUG_LIBRARY NAMES ${FTGL_STATIC_LIBRARY_NAME}_d
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
${module_file_path}/../../../External/lib )
MARK_AS_ADVANCED(FTGL_STATIC_DEBUG_LIBRARY)
IF( FTGL_STATIC_LIBRARY OR FTGL_STATIC_DEBUG_LIBRARY )
SET( FTGL_STATIC_LIBRARIES_FOUND 1 )
ENDIF( FTGL_STATIC_LIBRARY OR FTGL_STATIC_DEBUG_LIBRARY )
ENDIF( WIN32 AND PREFER_STATIC_LIBRARIES )
IF( FTGL_LIBRARY OR FTGL_STATIC_LIBRARIES_FOUND )
SET( FTGL_LIBRARIES_FOUND 1 )
ENDIF( FTGL_LIBRARY OR FTGL_STATIC_LIBRARIES_FOUND )
# Copy the results to the output variables.
IF(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
SET(FTGL_FOUND 1)
IF( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
IF(FTGL_STATIC_LIBRARY)
SET(FTGL_LIBRARIES optimized ${FTGL_STATIC_LIBRARY} )
ELSE(FTGL_STATIC_LIBRARY)
SET(FTGL_LIBRARIES optimized ${FTGL_STATIC_LIBRARY_NAME} )
MESSAGE( STATUS, "FTGL static release libraries not found. Release build might not work." )
ENDIF(FTGL_STATIC_LIBRARY)
IF(FTGL_STATIC_DEBUG_LIBRARY)
SET(FTGL_LIBRARIES ${FTGL_LIBRARIES} debug ${FTGL_STATIC_DEBUG_LIBRARY} )
ELSE(FTGL_STATIC_DEBUG_LIBRARY)
SET(FTGL_LIBRARIES ${FTGL_LIBRARIES} debug ${FTGL_STATIC_LIBRARY_NAME}_d )
MESSAGE( STATUS, "FTGL static debug libraries not found. Debug build might not work." )
ENDIF(FTGL_STATIC_DEBUG_LIBRARY)
SET( FTGL_LIBRARY_STATIC 1 )
ELSE( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
SET(FTGL_LIBRARIES ${FTGL_LIBRARY})
ENDIF( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
SET(FTGL_INCLUDE_DIR ${FTGL_INCLUDE_DIR})
ELSE(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
SET(FTGL_FOUND 0)
SET(FTGL_LIBRARIES)
SET(FTGL_INCLUDE_DIR)
ENDIF(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
# Report the results.
IF(NOT FTGL_FOUND)
SET(FTGL_DIR_MESSAGE
"FTGL was not found. Make sure FTGL_LIBRARY and FTGL_INCLUDE_DIR are set to the directories containing the include and lib files for FTGL. If you do not have the library you will not be able to use the Text node.")
IF(FTGL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${FTGL_DIR_MESSAGE}")
ELSEIF(NOT FTGL_FIND_QUIETLY)
MESSAGE(STATUS "${FTGL_DIR_MESSAGE}")
ELSE(NOT FTGL_FIND_QUIETLY)
ENDIF(FTGL_FIND_REQUIRED)
ENDIF(NOT FTGL_FOUND)
# - Find FTGL
# Find the native FTGL headers and libraries.
#
# FTGL_INCLUDE_DIR - where to find FTGL.h, etc.
# FTGL_LIBRARIES - List of libraries when using FTGL.
# FTGL_FOUND - True if FTGL found.
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Look for the header file.
FIND_PATH(FTGL_INCLUDE_DIR NAMES FTGL/ftgl.h
PATHS /usr/include
/usr/local/include
../../External/include
"C:\\libs\\ftgl\\ftgl"
${module_file_path}/../../../External/include)
#MARK_AS_ADVANCED(FTGL_INCLUDE_DIR)
# Look for the library.
FIND_LIBRARY(FTGL_LIBRARY NAMES ftgl ftgl_dynamic_MTD
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
"C:\\libs\\ftgl\\msvc\\Build"
${module_file_path}/../../../External/lib)
#MARK_AS_ADVANCED(FTGL_LIBRARY)
IF( WIN32 AND PREFER_STATIC_LIBRARIES )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD )
IF( MSVC80 )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD_vc8 )
ELSEIF( MSVC90 )
SET( FTGL_STATIC_LIBRARY_NAME ftgl_static_MTD_vc9 )
ENDIF( MSVC80 )
FIND_LIBRARY( FTGL_STATIC_LIBRARY NAMES ${FTGL_STATIC_LIBRARY_NAME}
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
${module_file_path}/../../../External/lib )
MARK_AS_ADVANCED(FTGL_STATIC_LIBRARY)
FIND_LIBRARY( FTGL_STATIC_DEBUG_LIBRARY NAMES ${FTGL_STATIC_LIBRARY_NAME}_d
PATHS /usr/lib64
/usr/local/lib64
/usr/lib
/usr/local/lib
../../External/lib
${module_file_path}/../../../External/lib )
MARK_AS_ADVANCED(FTGL_STATIC_DEBUG_LIBRARY)
IF( FTGL_STATIC_LIBRARY OR FTGL_STATIC_DEBUG_LIBRARY )
SET( FTGL_STATIC_LIBRARIES_FOUND 1 )
ENDIF( FTGL_STATIC_LIBRARY OR FTGL_STATIC_DEBUG_LIBRARY )
ENDIF( WIN32 AND PREFER_STATIC_LIBRARIES )
IF( FTGL_LIBRARY OR FTGL_STATIC_LIBRARIES_FOUND )
SET( FTGL_LIBRARIES_FOUND 1 )
ENDIF( FTGL_LIBRARY OR FTGL_STATIC_LIBRARIES_FOUND )
# Copy the results to the output variables.
IF(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
SET(FTGL_FOUND 1)
IF( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
IF(FTGL_STATIC_LIBRARY)
SET(FTGL_LIBRARIES optimized ${FTGL_STATIC_LIBRARY} )
ELSE(FTGL_STATIC_LIBRARY)
SET(FTGL_LIBRARIES optimized ${FTGL_STATIC_LIBRARY_NAME} )
MESSAGE( STATUS, "FTGL static release libraries not found. Release build might not work." )
ENDIF(FTGL_STATIC_LIBRARY)
IF(FTGL_STATIC_DEBUG_LIBRARY)
SET(FTGL_LIBRARIES ${FTGL_LIBRARIES} debug ${FTGL_STATIC_DEBUG_LIBRARY} )
ELSE(FTGL_STATIC_DEBUG_LIBRARY)
SET(FTGL_LIBRARIES ${FTGL_LIBRARIES} debug ${FTGL_STATIC_LIBRARY_NAME}_d )
MESSAGE( STATUS, "FTGL static debug libraries not found. Debug build might not work." )
ENDIF(FTGL_STATIC_DEBUG_LIBRARY)
SET( FTGL_LIBRARY_STATIC 1 )
ELSE( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
SET(FTGL_LIBRARIES ${FTGL_LIBRARY})
ENDIF( WIN32 AND PREFER_STATIC_LIBRARIES AND FTGL_STATIC_LIBRARIES_FOUND )
SET(FTGL_INCLUDE_DIR ${FTGL_INCLUDE_DIR})
ELSE(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
SET(FTGL_FOUND 0)
SET(FTGL_LIBRARIES)
SET(FTGL_INCLUDE_DIR)
ENDIF(FTGL_INCLUDE_DIR AND FTGL_LIBRARIES_FOUND)
# Report the results.
IF(NOT FTGL_FOUND)
SET(FTGL_DIR_MESSAGE
"FTGL was not found. Make sure FTGL_LIBRARY and FTGL_INCLUDE_DIR are set to the directories containing the include and lib files for FTGL. If you do not have the library you will not be able to use the Text node.")
IF(FTGL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${FTGL_DIR_MESSAGE}")
ELSEIF(NOT FTGL_FIND_QUIETLY)
MESSAGE(STATUS "${FTGL_DIR_MESSAGE}")
ELSE(NOT FTGL_FIND_QUIETLY)
ENDIF(FTGL_FIND_REQUIRED)
ENDIF(NOT FTGL_FOUND)
This diff is collapsed.
# 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 C:\\libs\\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}")
IF( NOT WIN32 )
# 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 )
ELSE( NOT WIN32)
IF( CMAKE_BUILD_TYPE MATCHES Release )
# Find Qwt5 library linked to Qt4 Release Version
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS "c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib" "c:\\libs\\qwt-5.2.0\\lib")
ELSE()
# Find Qwt5 library linked to Qt4 Debug Version
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5d PATHS "c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib" "c:\\libs\\qwt-5.2.0\\lib")
ENDIF()
ENDIF(NOT WIN32)
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 C:\\libs\\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}")
IF( NOT WIN32 )
# 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 )
ELSE( NOT WIN32)
IF( CMAKE_BUILD_TYPE MATCHES Release )
# Find Qwt5 library linked to Qt4 Release Version
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt5 qwt PATHS "c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib" "c:\\libs\\qwt-5.2.0\\lib")
ELSE()
# Find Qwt5 library linked to Qt4 Debug Version
FIND_LIBRARY( Qwt5_Qt4_TENTATIVE_LIBRARY NAMES qwt5d PATHS "c:\\Program\ Files\\qwt\\qwt-5.2.0\\lib" "c:\\libs\\qwt-5.2.0\\lib")
ENDIF()
ENDIF(NOT WIN32)
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 )
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