
		if(WIN32)
			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")			
			set(EXIV2_LIB_NAME "libexiv2.dll")
			set(EXPAT_LIB_NAME "libexpat.dll")
			set(ZLIB1_LIB_NAME "zlib1.dll")
			set(EXIV2_IMPORT_LIB_NAME "libexiv2.lib")
			set(EXPAT_IMPORT_LIB_NAME "libexpat.lib")
			set(ZLIB1_IMPORT_LIB_NAME "zlib1.lib")
		elseif(UNIX)
			set(EXIV2_LIB_NAME "libexiv2.so")
		endif()

		FIND_PATH(EXIV2_INCLUDE_DIR "exiv2.hpp")

		if(WIN32)
			FIND_LIBRARY(EXIV2_LIB_RELEASE "Release/${EXIV2_LIB_NAME}")
			FIND_LIBRARY(EXIV2_LIB_DEBUG "Debug/${EXIV2_LIB_NAME}")
			FIND_LIBRARY(EXPAT_LIB_RELEASE "Release/${EXPAT_LIB_NAME}")
			FIND_LIBRARY(EXPAT_LIB_DEBUG "Debug/${EXPAT_LIB_NAME}")
			FIND_LIBRARY(ZLIB1_LIB_RELEASE "Release/${ZLIB1_LIB_NAME}")
			FIND_LIBRARY(ZLIB1_LIB_DEBUG "Debug/${ZLIB1_LIB_NAME}")		
			if(NOT ${EXIV2_LIB_RELEASE} STREQUAL "EXIV2_LIB_RELEASE-NOTFOUND"
				AND NOT ${EXIV2_LIB_DEBUG} STREQUAL "EXIV2_LIB_DEBUG-NOTFOUND" 
				AND NOT ${EXIV2_LIB_RELEASE} STREQUAL "EXIV2_LIB_RELEASE-NOTFOUND"
				AND NOT ${EXPAT_LIB_RELEASE} STREQUAL "EXPAT_LIB_RELEASE-NOTFOUND"
				AND NOT ${EXPAT_LIB_DEBUG} STREQUAL "EXPAT_LIB_DEBUG-NOTFOUND"
				AND NOT ${ZLIB1_LIB_RELEASE} STREQUAL "ZLIB1_LIB_RELEASE-NOTFOUND"
				AND NOT ${ZLIB1_LIB_DEBUG} STREQUAL "ZLIB1_LIB_DEBUG-NOTFOUND")
				set(ALL_LIBS_FOUND ON)
			else()
				set(ALL_LIBS_FOUND OFF)
			endif()
		elseif(UNIX)
			FIND_LIBRARY(EXIV2_LIB_RELEASE "${EXIV2_LIB_NAME}")	
			if(NOT ${EXIV2_LIB_RELEASE} STREQUAL "EXIV2_LIB_RELEASE-NOTFOUND")
				set(ALL_LIBS_FOUND ON)
			else()
				set(ALL_LIBS_FOUND OFF)
			endif()
		endif()

		if(NOT ${EXIV2_INCLUDE_DIR} STREQUAL "EXIV2_INCLUDE_DIR-NOTFOUND" AND ${ALL_LIBS_FOUND})

			if(WIN32)
				add_library(expat SHARED IMPORTED)
				set_property(TARGET expat APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
				set_property(TARGET expat APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)		
				set_target_properties(expat PROPERTIES
									  INTERFACE_INCLUDE_DIRECTORIES ${EXIV2_INCLUDE_DIR}
									  IMPORTED_LOCATION_RELEASE "${EXPAT_LIB_RELEASE}"
									  IMPORTED_LOCATION_DEBUG "${EXPAT_LIB_DEBUG}")
				add_library(zlib1 SHARED IMPORTED)
				set_property(TARGET zlib1 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
				set_property(TARGET zlib1 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)		
				set_target_properties(zlib1 PROPERTIES
									  INTERFACE_INCLUDE_DIRECTORIES ${EXIV2_INCLUDE_DIR}
									  IMPORTED_LOCATION_RELEASE "${ZLIB1_LIB_RELEASE}"
									  IMPORTED_LOCATION_DEBUG "${ZLIB1_LIB_DEBUG}")	
			endif()

			add_library(exiv2 SHARED IMPORTED)
			set_property(TARGET exiv2 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)

			if(WIN32)
			set_property(TARGET exiv2 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)		
			set_target_properties(exiv2 PROPERTIES
								  INTERFACE_INCLUDE_DIRECTORIES ${EXIV2_INCLUDE_DIR}
								  IMPORTED_LOCATION_RELEASE "${EXIV2_LIB_RELEASE}"
								  IMPORTED_LOCATION_DEBUG "${EXIV2_LIB_DEBUG}"
								  IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "expat;zlib1"
									IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "expat;zlib1")		
			elseif(UNIX)
				set_property(TARGET exiv2 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)		
				set_target_properties(exiv2 PROPERTIES
									  INTERFACE_INCLUDE_DIRECTORIES ${EXIV2_INCLUDE_DIR}
									  IMPORTED_LOCATION_RELEASE "${EXIV2_LIB_RELEASE}")		
			endif()						  	

			if(WIN32)
				FIND_LIBRARY(EXIV2_IMPORT_LIB_RELEASE "Release/${EXIV2_IMPORT_LIB_NAME}")
				FIND_LIBRARY(EXIV2_IMPORT_LIB_DEBUG "Debug/${EXIV2_IMPORT_LIB_NAME}")
				FIND_LIBRARY(EXPAT_IMPORT_LIB_RELEASE "Release/${EXPAT_IMPORT_LIB_NAME}")
				FIND_LIBRARY(EXPAT_IMPORT_LIB_DEBUG "Debug/${EXPAT_IMPORT_LIB_NAME}")
				FIND_LIBRARY(ZLIB1_IMPORT_LIB_RELEASE "Release/${ZLIB1_IMPORT_LIB_NAME}")
				FIND_LIBRARY(ZLIB1_IMPORT_LIB_DEBUG "Debug/${ZLIB1_IMPORT_LIB_NAME}")	
				if(NOT ${EXIV2_IMPORT_LIB_RELEASE} STREQUAL "EXIV2_IMPORT_LIB_RELEASE-NOTFOUND"
					AND NOT ${EXIV2_IMPORT_LIB_DEBUG} STREQUAL "EXIV2_IMPORT_LIB_DEBUG-NOTFOUND"
					AND NOT ${EXIV2_IMPORT_LIB_RELEASE} STREQUAL "EXIV2_IMPORT_LIB_RELEASE-NOTFOUND"
					AND NOT ${EXPAT_IMPORT_LIB_RELEASE} STREQUAL "EXPAT_IMPORT_LIB_RELEASE-NOTFOUND"
					AND NOT ${EXPAT_IMPORT_LIB_DEBUG} STREQUAL "EXPAT_IMPORT_LIB_DEBUG-NOTFOUND"
					AND NOT ${ZLIB1_IMPORT_LIB_RELEASE} STREQUAL "ZLIB1_IMPORT_LIB_RELEASE-NOTFOUND"
					AND NOT ${ZLIB1_IMPORT_LIB_DEBUG} STREQUAL "ZLIB1_IMPORT_LIB_DEBUG-NOTFOUND")
					set(ALL_IMPORT_LIBS_FOUND ON)
				else()
					set(ALL_IMPORT_LIBS_FOUND OFF)
				endif()

				if(${ALL_IMPORT_LIBS_FOUND})
					set_target_properties(exiv2 PROPERTIES
					  					  IMPORTED_IMPLIB_RELEASE "${EXIV2_IMPORT_LIB_RELEASE}"
					  					  IMPORTED_IMPLIB_DEBUG "${EXIV2_IMPORT_LIB_DEBUG}")
					set_target_properties(expat PROPERTIES
					  					  IMPORTED_IMPLIB_RELEASE "${EXPAT_IMPORT_LIB_RELEASE}"
					  					  IMPORTED_IMPLIB_DEBUG "${EXPAT_IMPORT_LIB_DEBUG}")
					set_target_properties(zlib1 PROPERTIES
					  					  IMPORTED_IMPLIB_RELEASE "${ZLIB1_IMPORT_LIB_RELEASE}"
					  					  IMPORTED_IMPLIB_DEBUG "${ZLIB1_IMPORT_LIB_DEBUG}")
				else()
					message("Exiv2 import lib could not be found.")
				endif()

			endif()

		else()

			message("Exiv2 could not be found.")

		endif()