1
#-------------------------------------------------------------------
2
# This file is part of the CMake build system for OGRE
3
# (Object-oriented Graphics Rendering Engine)
4
# For the latest info, see http://www.ogre3d.org/
6
# The contents of this file are placed in the public domain. Feel
7
# free to make use of it in any way you like.
8
#-------------------------------------------------------------------
10
# - Try to find FreeImage
11
# Once done, this will define
13
# FreeImage_FOUND - system has FreeImage
14
# FreeImage_INCLUDE_DIRS - the FreeImage include directories
15
# FreeImage_LIBRARIES - link these to use FreeImage
17
include(FindPkgMacros)
18
findpkg_begin(FreeImage)
20
# Get path, convert backslashes as ${ENV_${var}}
21
getenv_path(FREEIMAGE_HOME)
23
# construct search paths
24
set(FreeImage_PREFIX_PATH ${FREEIMAGE_HOME} ${ENV_FREEIMAGE_HOME})
25
create_search_paths(FreeImage)
26
# redo search if prefix path changed
27
clear_if_changed(FreeImage_PREFIX_PATH
34
set(FreeImage_LIBRARY_NAMES freeimage)
35
get_debug_names(FreeImage_LIBRARY_NAMES)
37
use_pkgconfig(FreeImage_PKGC freeimage)
39
findpkg_framework(FreeImage)
41
find_path(FreeImage_INCLUDE_DIR NAMES FreeImage.h HINTS ${FreeImage_INC_SEARCH_PATH} ${FreeImage_PKGC_INCLUDE_DIRS})
42
find_library(FreeImage_LIBRARY_REL NAMES ${FreeImage_LIBRARY_NAMES} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
43
find_library(FreeImage_LIBRARY_DBG NAMES ${FreeImage_LIBRARY_NAMES_DBG} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
44
make_library_set(FreeImage_LIBRARY)
46
findpkg_finish(FreeImage)