2008-01-30 22:08:44 +00:00
|
|
|
# - Try to find the libspectre PS library
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# LIBSPECTRE_FOUND - system has libspectre
|
|
|
|
# LIBSPECTRE_INCLUDE_DIR - the libspectre include directory
|
|
|
|
# LIBSPECTRE_LIBRARY - Link this to use libspectre
|
|
|
|
#
|
|
|
|
|
|
|
|
# Copyright (c) 2006-2007, Pino Toscano, <pino@kde.org>
|
|
|
|
# Copyright (c) 2008, Albert Astals Cid, <aacid@kde.org>
|
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
|
|
|
if(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
|
|
|
|
|
|
|
|
# in cache already
|
2013-01-21 23:10:28 +00:00
|
|
|
set(LIBSPECTRE_INTERNAL_FOUND TRUE)
|
2008-01-30 22:08:44 +00:00
|
|
|
|
|
|
|
else(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
|
|
|
|
|
2008-05-05 11:44:53 +00:00
|
|
|
if(NOT WIN32)
|
2015-04-17 08:50:03 +00:00
|
|
|
# use pkg-config to get the directories and then use these values
|
|
|
|
# in the FIND_PATH() and FIND_LIBRARY() calls
|
|
|
|
include(FindPkgConfig)
|
|
|
|
|
|
|
|
if(LIBSPECTRE_MINIMUM_VERSION})
|
|
|
|
pkg_check_modules(_pc_LIBSPECTRE libspectre>=${LIBSPECTRE_MINIMUM_VERSION})
|
|
|
|
else(LIBSPECTRE_MINIMUM_VERSION})
|
|
|
|
pkg_check_modules(_pc_LIBSPECTRE libspectre)
|
|
|
|
endif(LIBSPECTRE_MINIMUM_VERSION})
|
2008-08-28 00:05:31 +00:00
|
|
|
else(NOT WIN32)
|
2015-04-17 08:50:03 +00:00
|
|
|
# do not use pkg-config on windows
|
|
|
|
set(_pc_LIBSPECTRE_FOUND TRUE)
|
2008-05-05 11:44:53 +00:00
|
|
|
endif(NOT WIN32)
|
2008-01-30 22:08:44 +00:00
|
|
|
|
|
|
|
|
2015-04-17 08:50:03 +00:00
|
|
|
if(_pc_LIBSPECTRE_FOUND)
|
|
|
|
find_library(LIBSPECTRE_LIBRARY
|
|
|
|
NAMES libspectre spectre
|
|
|
|
HINTS ${_pc_LIBSPECTRE_LIBRARY_DIRS} ${CMAKE_LIBRARY_PATH}
|
|
|
|
)
|
2008-01-30 22:08:44 +00:00
|
|
|
|
2015-04-17 08:50:03 +00:00
|
|
|
find_path(LIBSPECTRE_INCLUDE_DIR spectre.h
|
|
|
|
HINTS ${_pc_LIBSPECTRE_INCLUDE_DIRS}
|
|
|
|
PATH_SUFFIXES libspectre
|
|
|
|
)
|
|
|
|
|
|
|
|
set(LIBSPECTRE_INTERNAL_FOUND TRUE)
|
|
|
|
endif(_pc_LIBSPECTRE_FOUND)
|
2008-01-30 22:08:44 +00:00
|
|
|
|
2008-03-04 10:39:49 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2013-01-21 23:10:28 +00:00
|
|
|
find_package_handle_standard_args(LibSpectre DEFAULT_MSG LIBSPECTRE_LIBRARY LIBSPECTRE_INTERNAL_FOUND)
|
2008-03-04 10:39:49 +00:00
|
|
|
|
2008-01-30 22:08:44 +00:00
|
|
|
# ensure that they are cached
|
|
|
|
set(LIBSPECTRE_INCLUDE_DIR ${LIBSPECTRE_INCLUDE_DIR} CACHE INTERNAL "The libspectre include path")
|
|
|
|
set(LIBSPECTRE_LIBRARY ${LIBSPECTRE_LIBRARY} CACHE INTERNAL "The libspectre library")
|
|
|
|
|
|
|
|
endif(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
|