--- CMakeLists.txt.orig	2016-06-08 20:55:08 UTC
+++ CMakeLists.txt
@@ -16,7 +16,6 @@ SET(PODOFO_VERSION_PATCH "4" CACHE STRIN
 SET(PODOFO_SOVERSION "${PODOFO_VERSION_MAJOR}.${PODOFO_VERSION_MINOR}.${PODOFO_VERSION_PATCH}")
 SET(PODOFO_LIBVERSION "${PODOFO_SOVERSION}")
 
-
 #
 # Main includes
 #
@@ -345,6 +344,7 @@ ELSE(LIBIDN_FOUND)
 	MESSAGE("Libidn not found. AES-256 Encryption support will be disabled")
 ENDIF(LIBIDN_FOUND)
 
+IF(WANT_LIBJPEG)
 FIND_PACKAGE(LIBJPEG)
 
 IF(LIBJPEG_FOUND)
@@ -354,7 +354,9 @@ IF(LIBJPEG_FOUND)
 ELSE(LIBJPEG_FOUND)
   MESSAGE("Libjpeg not found. JPEG support will be disabled")
 ENDIF(LIBJPEG_FOUND)
+ENDIF(WANT_LIBJPEG)
 
+IF(WANT_TIFF)
 FIND_PACKAGE(TIFF)
 
 IF(TIFF_FOUND)
@@ -364,7 +366,9 @@ IF(TIFF_FOUND)
 ELSE(TIFF_FOUND)
   MESSAGE("Libtiff not found. TIFF support will be disabled")
 ENDIF(TIFF_FOUND)
+ENDIF(WANT_TIFF)
 
+IF(WANT_PNG)
 FIND_PACKAGE(PNG)
 
 IF(PNG_FOUND)
@@ -374,9 +378,11 @@ IF(PNG_FOUND)
 ELSE(PNG_FOUND)
   MESSAGE("LibPng not found. PNG support will be disabled")
 ENDIF(PNG_FOUND)
+ENDIF(WANT_PNG)
 
 IF(NOT PODOFO_BUILD_LIB_ONLY)
 
+IF(WANT_CppUnit)
 FIND_PACKAGE(CppUnit)
 
 IF(CppUnit_FOUND)
@@ -386,6 +392,7 @@ IF(CppUnit_FOUND)
 ELSE(CppUnit_FOUND)
   MESSAGE("Cppunit not found. No unit tests will be built.")
 ENDIF(CppUnit_FOUND)
+ENDIF(WANT_CppUnit)
 
 ENDIF(NOT PODOFO_BUILD_LIB_ONLY)
 
@@ -426,6 +433,7 @@ ELSE(WANT_FONTCONFIG)
 ENDIF(WANT_FONTCONFIG)
 
 IF(NOT PODOFO_BUILD_LIB_ONLY)
+IF(WANT_LUA)
 FIND_PACKAGE(LUA)
 IF(LUA_FOUND)
 	# If we have lua, we can build podofoimpose.
@@ -437,6 +445,7 @@ IF(LUA_FOUND)
 ELSE(LUA_FOUND)
 	MESSAGE("Lua not found - PoDoFoImpose and PoDoFoColor will be built without Lua support")
 ENDIF(LUA_FOUND)
+ENDIF(WANT_LUA)
 ENDIF(NOT PODOFO_BUILD_LIB_ONLY)
 
 
@@ -510,7 +519,7 @@ SET(PODOFO_LIB
 #
 # Setup directories we will need
 #
-SET(MANDIR "share/man/")
+SET(MANDIR "man/")
 
 # Create the config file. It'll be appended to as the subdirs run though
 # then dependency information will be written to it at the end of the
