1# - Find OpenJPEG library 2# Find the native OpenJPEG includes and library 3# This module defines 4# OPENJPEG_INCLUDE_DIRS, where to find openjpeg.h, Set when 5# OPENJPEG_INCLUDE_DIR is found. 6# OPENJPEG_LIBRARIES, libraries to link against to use OpenJPEG. 7# OPENJPEG_ROOT_DIR, The base directory to search for OpenJPEG. 8# This can also be an environment variable. 9# OPENJPEG_FOUND, If false, do not try to use OpenJPEG. 10# 11# also defined, but not for general use are 12# OPENJPEG_LIBRARY, where to find the OpenJPEG library. 13 14#============================================================================= 15# Copyright 2011 Blender Foundation. 16# 17# Distributed under the OSI-approved BSD 3-Clause License, 18# see accompanying file BSD-3-Clause-license.txt for details. 19#============================================================================= 20 21# If OPENJPEG_ROOT_DIR was defined in the environment, use it. 22IF(NOT OPENJPEG_ROOT_DIR AND NOT $ENV{OPENJPEG_ROOT_DIR} STREQUAL "") 23 SET(OPENJPEG_ROOT_DIR $ENV{OPENJPEG_ROOT_DIR}) 24ENDIF() 25 26SET(_openjpeg_SEARCH_DIRS 27 ${OPENJPEG_ROOT_DIR} 28) 29 30FIND_PATH(OPENJPEG_INCLUDE_DIR 31 NAMES 32 openjpeg.h 33 HINTS 34 ${_openjpeg_SEARCH_DIRS} 35 PATH_SUFFIXES 36 include 37 # Support future versions 38 openjpeg-2.9 39 openjpeg-2.8 40 openjpeg-2.7 41 openjpeg-2.6 42 openjpeg-2.5 43 openjpeg-2.4 44 openjpeg-2.3 45 openjpeg-2.2 46 openjpeg-2.1 47 openjpeg-2.0 48) 49 50FIND_LIBRARY(OPENJPEG_LIBRARY 51 NAMES 52 openjp2 53 HINTS 54 ${_openjpeg_SEARCH_DIRS} 55 PATH_SUFFIXES 56 lib64 lib 57 ) 58 59# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if 60# all listed variables are TRUE 61INCLUDE(FindPackageHandleStandardArgs) 62FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG 63 OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR) 64 65IF(OPENJPEG_FOUND) 66 SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY}) 67 SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR}) 68ENDIF() 69 70MARK_AS_ADVANCED( 71 OPENJPEG_INCLUDE_DIR 72 OPENJPEG_LIBRARY 73) 74 75UNSET(_openjpeg_SEARCH_DIRS) 76