-
-
Notifications
You must be signed in to change notification settings - Fork 980
/
FindFreeImage.cmake
49 lines (37 loc) · 1.73 KB
/
FindFreeImage.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
# (Object-oriented Graphics Rendering Engine)
# For the latest info, see http://www.ogre3d.org/
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------
# - Try to find FreeImage
# Once done, this will define
#
# FreeImage_FOUND - system has FreeImage
# FreeImage_INCLUDE_DIRS - the FreeImage include directories
# FreeImage_LIBRARIES - link these to use FreeImage
include(FindPkgMacros)
findpkg_begin(FreeImage)
# Get path, convert backslashes as ${ENV_${var}}
getenv_path(FREEIMAGE_HOME)
# construct search paths
set(FreeImage_PREFIX_PATH ${FREEIMAGE_HOME} ${ENV_FREEIMAGE_HOME})
create_search_paths(FreeImage)
# redo search if prefix path changed
clear_if_changed(FreeImage_PREFIX_PATH
FreeImage_LIBRARY_FWK
FreeImage_LIBRARY_REL
FreeImage_LIBRARY_DBG
FreeImage_INCLUDE_DIR
)
set(FreeImage_LIBRARY_NAMES freeimage freeimageLib FreeImage FreeImageLib)
get_debug_names(FreeImage_LIBRARY_NAMES)
use_pkgconfig(FreeImage_PKGC freeimage)
findpkg_framework(FreeImage)
find_path(FreeImage_INCLUDE_DIR NAMES FreeImage.h HINTS ${FreeImage_INC_SEARCH_PATH} ${FreeImage_PKGC_INCLUDE_DIRS})
find_library(FreeImage_LIBRARY_REL NAMES ${FreeImage_LIBRARY_NAMES} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)
find_library(FreeImage_LIBRARY_DBG NAMES ${FreeImage_LIBRARY_NAMES_DBG} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug)
make_library_set(FreeImage_LIBRARY)
findpkg_finish(FreeImage)