if(CMAKE_SIZEOF_VOID_P EQUAL 8)
	set(ASSIMP_ARCHITECTURE "64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
	set(ASSIMP_ARCHITECTURE "32")
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
	
if(WIN32)
	set(ASSIMP_ROOT_DIR $ENV{ASSIMP_ROOT_DIR} CACHE PATH "ASSIMP root directory")

	# Find path of each library
	find_path(ASSIMP_INCLUDE_DIR
		NAMES
			assimp/anim.h
		HINTS
			${ASSIMP_ROOT_DIR}/include
	)

	if(MSVC12)
		set(ASSIMP_MSVC_VERSION "vc120")
	else()	
		set(ASSIMP_MSVC_VERSION "vc140")
	endif(MSVC12)
		
	find_path(ASSIMP_LIBRARY_DIR
		NAMES
			assimp-${ASSIMP_MSVC_VERSION}-mt.lib
		HINTS
			${ASSIMP_ROOT_DIR}/lib#${ASSIMP_ARCHITECTURE}
	)
		
	find_library(ASSIMP_LIBRARY_RELEASE				assimp-${ASSIMP_MSVC_VERSION}-mt.lib 			PATHS ${ASSIMP_LIBRARY_DIR})
#	find_library(ASSIMP_LIBRARY_DEBUG				assimp-${ASSIMP_MSVC_VERSION}-mtd.lib			PATHS ${ASSIMP_LIBRARY_DIR})
		
	set(ASSIMP_LIBRARY 
		optimized 	${ASSIMP_LIBRARY_RELEASE}
#		debug		${ASSIMP_LIBRARY_DEBUG}
	)
		
	set(ASSIMP_LIBRARIES "ASSIMP_LIBRARY_RELEASE" "ASSIMP_LIBRARY_DEBUG")
	
	FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory)
		ADD_CUSTOM_TARGET(AssimpCopyBinaries
		#	COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll 	${TargetDirectory}/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll
			COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin/assimp-${ASSIMP_MSVC_VERSION}-mt.dll 		${TargetDirectory}/assimp-${ASSIMP_MSVC_VERSION}-mt.dll
		COMMENT "Copying Assimp binaries to '${TargetDirectory}'"
		VERBATIM)
	ENDFUNCTION(ASSIMP_COPY_BINARIES)
		
else(WIN32)
	find_path(
		ASSIMP_INCLUDE_DIR
		NAMES postprocess.h scene.h version.h config.h cimport.h
		PATHS /usr/include/assimp
	)
	if (NOT ASSIMP_INCLUDE_DIR)
		find_path(
			ASSIMP_INCLUDE_DIR
			NAMES postprocess.h scene.h version.h config.h cimport.h
			PATHS /usr/local/include/assimp
		)
	endif()

	find_library(
	  ASSIMP_LIBRARY
	  NAMES assimp
	  PATHS /usr/lib/
	)
	if (NOT ASSIMP_LIBRARY)
		find_library(
			ASSIMP_LIBRARY
			NAMES assimp
			PATHS /usr/local/lib/
		)
	endif()

	if (ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY)
		SET(assimp_FOUND TRUE)
		SET(ASSIMP_LIBRARY_RELEASE ${ASSIMP_LIBRARY})
	ENDIF (ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY)

	if (assimp_FOUND)
	  if (NOT assimp_FIND_QUIETLY)
		message(STATUS "Found asset importer library: ${ASSIMP_LIBRARY}")
	  endif (NOT assimp_FIND_QUIETLY)
	else (assimp_FOUND)
	  if (assimp_FIND_REQUIRED)
		message(FATAL_ERROR "Could not find asset importer library")
	  endif (assimp_FIND_REQUIRED)
	endif (assimp_FOUND)
	
endif(WIN32)