PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/FindOpenJPEG.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 50 lines | 32 code | 8 blank | 10 comment | 0 complexity | 4412526ceecbc50f51a883c3e94f26c3 MD5 | raw file
 1# -*- cmake -*-
 2
 3# - Find OpenJPEG
 4# Find the OpenJPEG includes and library
 5# This module defines
 6#  OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
 7#  OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
 8#  OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
 9# also defined, but not for general use are
10#  OPENJPEG_LIBRARY, where to find the OpenJPEG library.
11
12FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
13/usr/local/include/openjpeg
14/usr/local/include
15/usr/include/openjpeg
16/usr/include
17)
18
19SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
20FIND_LIBRARY(OPENJPEG_LIBRARY
21  NAMES ${OPENJPEG_NAMES}
22  PATHS /usr/lib /usr/local/lib
23  )
24
25IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
26    SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
27    SET(OPENJPEG_FOUND "YES")
28ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
29  SET(OPENJPEG_FOUND "NO")
30ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
31
32
33IF (OPENJPEG_FOUND)
34   IF (NOT OPENJPEG_FIND_QUIETLY)
35      MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
36   ENDIF (NOT OPENJPEG_FIND_QUIETLY)
37ELSE (OPENJPEG_FOUND)
38   IF (OPENJPEG_FIND_REQUIRED)
39      MESSAGE(FATAL_ERROR "Could not find OpenJPEG library")
40   ENDIF (OPENJPEG_FIND_REQUIRED)
41ENDIF (OPENJPEG_FOUND)
42
43# Deprecated declarations.
44SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} )
45GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH)
46
47MARK_AS_ADVANCED(
48  OPENJPEG_LIBRARY
49  OPENJPEG_INCLUDE_DIR
50  )