2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# FindJasper
|
|
|
|
# ----------
|
|
|
|
#
|
|
|
|
# Try to find the Jasper JPEG2000 library
|
|
|
|
#
|
2006-09-20 00:11:53 +04:00
|
|
|
# Once done this will define
|
|
|
|
#
|
2013-10-15 19:17:36 +04:00
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# JASPER_FOUND - system has Jasper
|
|
|
|
# JASPER_INCLUDE_DIR - the Jasper include directory
|
|
|
|
# JASPER_LIBRARIES - the libraries needed to use Jasper
|
|
|
|
# JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2006-2009 Kitware, Inc.
|
|
|
|
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
2012-01-22 16:09:33 +04:00
|
|
|
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
|
2006-09-20 00:11:53 +04:00
|
|
|
#
|
2009-09-28 19:45:50 +04:00
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (NOT JASPER_LIBRARIES)
|
|
|
|
find_package(JPEG)
|
2012-01-22 14:15:24 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
|
|
|
|
find_library(JASPER_LIBRARY_DEBUG NAMES jasperd)
|
2012-01-22 14:15:24 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
2012-01-22 14:15:24 +04:00
|
|
|
SELECT_LIBRARY_CONFIGURATIONS(JASPER)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
|
|
|
|
file(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
|
2012-01-22 16:09:33 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
string(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2012-01-22 16:09:33 +04:00
|
|
|
|
2012-08-13 21:42:58 +04:00
|
|
|
# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
|
2007-07-18 21:56:45 +04:00
|
|
|
# all listed variables are TRUE
|
2012-08-13 21:47:32 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
2012-01-22 16:09:33 +04:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
|
|
|
|
REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
|
|
|
|
VERSION_VAR JASPER_VERSION_STRING)
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (JASPER_FOUND)
|
|
|
|
set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2006-09-20 00:11:53 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(JASPER_INCLUDE_DIR)
|