-
Notifications
You must be signed in to change notification settings - Fork 64
/
FindCTL.cmake
81 lines (69 loc) · 2.12 KB
/
FindCTL.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# - Find CTL library
# CTL stands for Color transform language
# http://ampasctl.sourceforge.net/
# Find the native CTL includes and library
# This module defines
# CTL_INCLUDE_DIRS, where to find openimageio.h, Set when
# CTL_INCLUDE_DIR is found.
# CTL_LIBRARIES, libraries to link against to use CTL.
# CTL_ROOT_DIR, The base directory to search for CTL.
# This can also be an environment variable.
# CTL_FOUND, If false, do not try to use CTL.
#
# If CTL_ROOT was defined in the environment, use it, otherwise
# try to use pkgconfig
if(NOT CTL_ROOT_DIR AND NOT $ENV{CTL_ROOT} STREQUAL "")
set(CTL_ROOT_DIR $ENV{CTL_ROOT})
else()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(CTLPKG QUIET CTL)
endif()
endif()
set(_ctl_SEARCH_DIRS
${CTL_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/ocio
)
find_path(CTL_INCLUDE_DIR
NAMES CTL/CtlVersion.h
HINTS ${_ctl_SEARCH_DIRS} ${CTLPKG_INCLUDE_DIRS}
PATH_SUFFIXES include
)
find_library(CTL_ILMIMF_LIB
NAMES IlmImfCtl
HINTS ${_ctl_SEARCH_DIRS} ${CTLPKG_LIBRARY_DIRS}
PATH_SUFFIXES lib64 lib
)
find_library(CTL_ILMCTL_LIB
NAMES IlmCtl
HINTS ${_ctl_SEARCH_DIRS} ${CTLPKG_LIBRARY_DIRS}
PATH_SUFFIXES lib64 lib
)
find_library(CTL_ILMCTLMATH_LIB
NAMES IlmCtlMath
HINTS ${_ctl_SEARCH_DIRS} ${CTLPKG_LIBRARY_DIRS}
PATH_SUFFIXES lib64 lib
)
find_library(CTL_ILMCTLSIMD_LIB
NAMES IlmCtlSimd
HINTS ${_ctl_SEARCH_DIRS} ${CTLPKG_LIBRARY_DIRS}
PATH_SUFFIXES lib64 lib
)
set(CTL_LIBS ${CTL_ILMIMF_LIB} ${CTL_ILMCTL_LIB} ${CTL_ILMCTLMATH_LIB} ${CTL_ILMCTLSIMD_LIB})
# handle the QUIETLY and REQUIRED arguments and set CTL_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CTL DEFAULT_MSG
CTL_LIBS CTL_INCLUDE_DIR)
if(CTL_FOUND)
set(CTL_LIBRARIES ${CTL_LIBS})
set(CTL_INCLUDE_DIRS ${CTL_INCLUDE_DIR} ${CTL_INCLUDE_DIR}/CTL)
endif(CTL_FOUND)
mark_as_advanced(
CTL_INCLUDE_DIR
CTL_LIBRARIES
)