# 设置查找路径
set (search_header  ${PROJECT_SOURCE_DIR}/modules/FreeImage/x32)
set (search_staticlib ${PROJECT_SOURCE_DIR}/modules/FreeImage/x32)
set (search_sharedlib ${PROJECT_SOURCE_DIR}/modules/FreeImage/x32)

# 搜索头文件
FIND_PATH(FREEIMAGEX32_INCLUDE_DIR FreeImage.h ${search_header})

# 搜索链接库
FILE(GLOB_RECURSE FREEIMAGEX32_STATICLIB ${search_staticlib}/FreeImage.lib)

# 搜索dll
FILE(GLOB_RECURSE FREEIMAGEX32_SHAREDLIB ${search_sharedlib}/FreeImage.dll)

IF (FREEIMAGEX32_INCLUDE_DIR AND FREEIMAGEX32_STATICLIB AND FREEIMAGEX32_SHAREDLIB)
    SET(FREEIMAGEX32_FOUND TRUE)
ENDIF (FREEIMAGEX32_INCLUDE_DIR AND FREEIMAGEX32_STATICLIB AND FREEIMAGEX32_SHAREDLIB)

# 删除临时变量
unset(search_header)
unset(search_staticlib)
unset(search_sharedlib)
