macro_optional_find_package(JPEG)
if(JPEG_FOUND)
   set(HAVE_LIBJPEG 1)
   add_subdirectory( djvu ) 
endif(JPEG_FOUND)

if(FreeType2_FOUND)
   add_subdirectory( dvi ) 
endif(FreeType2_FOUND)

macro_optional_find_package(TIFF)
if(TIFF_FOUND)
   # check that the tiff library has TIFFReadRGBAImageOriented
   macro_push_required_vars()
   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${TIFF_LIBRARIES})
   check_symbol_exists(TIFFReadRGBAImageOriented "tiffio.h" HAVE_TIFF_READ_RGBA_IMAGE_ORIENTED)
   macro_pop_required_vars()
   if (HAVE_TIFF_READ_RGBA_IMAGE_ORIENTED)
      add_subdirectory( fax )
   endif (HAVE_TIFF_READ_RGBA_IMAGE_ORIENTED)
endif(TIFF_FOUND)

macro_optional_find_package(PopplerQt4)
if (POPPLER_QT4_FOUND)
	#add_subdirectory( pdf )
endif (POPPLER_QT4_FOUND)

add_subdirectory( ps )

macro_log_feature(JPEG_FOUND                         "JPEG library" "The JPEG library is required for building the Ligature djvu-plugin" "http://www.ijg.org")
macro_log_feature(HAVE_TIFF_READ_RGBA_IMAGE_ORIENTED "TIFF library" "A TIFF library with TIFFReadRGBAImageOriented() is required for the Ligature TIFF plugin" "http://www.libtiff.org")
macro_log_feature(POPPLER_QT4_FOUND                  "Poppler"      "The Qt4 Poppler library is required for the Ligature PDF-plugin" "http://poppler.freedesktop.org")
