diff --git a/CMakeLists.txt b/CMakeLists.txt index c036c432f..b7d941e9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,6 +123,7 @@ FIND_PACKAGE(SDL) FIND_PACKAGE(Inventor) FIND_PACKAGE(Qt3) FIND_PACKAGE(Qt4) +FIND_PACKAGE(Jasper) # Platform specific: # (We can approach this one of two ways. We can try to FIND everything diff --git a/CMakeModules/FindJasper.cmake b/CMakeModules/FindJasper.cmake new file mode 100644 index 000000000..36050aecf --- /dev/null +++ b/CMakeModules/FindJasper.cmake @@ -0,0 +1,55 @@ +# Locate gdal +# This module defines +# JASPER_LIBRARY +# JASPER_FOUND, if false, do not try to link to gdal +# JASPER_INCLUDE_DIR, where to find the headers +# +# $JASPER_DIR is an environment variable that would +# correspond to the ./configure --prefix=$JASPER_DIR +# +# Created by Robert Osfield. + +FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h + $ENV{JASPER_DIR}/include + $ENV{JASPER_DIR} + $ENV{OSGDIR}/include + $ENV{OSGDIR} + $ENV{OSG_ROOT}/include + ~/Library/Frameworks + /Library/Frameworks + /usr/local/include + /usr/include + /sw/include # Fink + /opt/local/include # DarwinPorts + /opt/csw/include # Blastwave + /opt/include + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include + /usr/freeware/include +) + +FIND_LIBRARY(JASPER_LIBRARY + NAMES jasper + PATHS + $ENV{JASPER_DIR}/lib + $ENV{JASPER_DIR} + $ENV{OSGDIR}/lib + $ENV{OSGDIR} + $ENV{OSG_ROOT}/lib + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib + /usr/freeware/lib64 +) + +SET(JASPER_FOUND "NO") +IF(JASPER_LIBRARY AND JASPER_INCLUDE_DIR) + SET(JASPER_FOUND "YES") +ENDIF(JASPER_LIBRARY AND JASPER_INCLUDE_DIR) + + diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index f04723272..b04a31a4a 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -66,6 +66,9 @@ IF (BUILD_OSG_IMAGE_PLUGINS) IF(JPEG_FOUND) ADD_SUBDIRECTORY(jpeg) ENDIF(JPEG_FOUND) + IF(JASPER_FOUND) + ADD_SUBDIRECTORY(jp2) + ENDIF(JASPER_FOUND) IF(GIFLIB_FOUND) ADD_SUBDIRECTORY(gif) ENDIF(GIFLIB_FOUND) diff --git a/src/osgPlugins/jp2/CMakeLists.txt b/src/osgPlugins/jp2/CMakeLists.txt new file mode 100644 index 000000000..24b070167 --- /dev/null +++ b/src/osgPlugins/jp2/CMakeLists.txt @@ -0,0 +1,8 @@ +INCLUDE_DIRECTORIES( ${JAPSER_INCLUDE_DIR} ) + +SET(TARGET_SRC ReaderWriterJP2.cpp ) + +SET(TARGET_LIBRARIES_VARS JASPER_LIBRARY ) + +#### end var setup ### +SETUP_PLUGIN(jp2)