summaryrefslogtreecommitdiff
path: root/indra/cmake/FindOpenJPEG.cmake
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/cmake/FindOpenJPEG.cmake
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/cmake/FindOpenJPEG.cmake')
-rw-r--r--indra/cmake/FindOpenJPEG.cmake50
1 files changed, 50 insertions, 0 deletions
diff --git a/indra/cmake/FindOpenJPEG.cmake b/indra/cmake/FindOpenJPEG.cmake
new file mode 100644
index 0000000000..949384eec4
--- /dev/null
+++ b/indra/cmake/FindOpenJPEG.cmake
@@ -0,0 +1,50 @@
+# -*- cmake -*-
+
+# - Find OpenJPEG
+# Find the OpenJPEG includes and library
+# This module defines
+# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
+# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
+# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
+# also defined, but not for general use are
+# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
+
+FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
+/usr/local/include/openjpeg
+/usr/local/include
+/usr/include/openjpeg
+/usr/include
+)
+
+SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
+FIND_LIBRARY(OPENJPEG_LIBRARY
+ NAMES ${OPENJPEG_NAMES}
+ PATHS /usr/lib /usr/local/lib
+ )
+
+IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+ SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
+ SET(OPENJPEG_FOUND "YES")
+ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+ SET(OPENJPEG_FOUND "NO")
+ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+
+
+IF (OPENJPEG_FOUND)
+ IF (NOT OPENJPEG_FIND_QUIETLY)
+ MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
+ ENDIF (NOT OPENJPEG_FIND_QUIETLY)
+ELSE (OPENJPEG_FOUND)
+ IF (OPENJPEG_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find OpenJPEG library")
+ ENDIF (OPENJPEG_FIND_REQUIRED)
+ENDIF (OPENJPEG_FOUND)
+
+# Deprecated declarations.
+SET (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} )
+GET_FILENAME_COMPONENT (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH)
+
+MARK_AS_ADVANCED(
+ OPENJPEG_LIBRARY
+ OPENJPEG_INCLUDE_DIR
+ )