|
3 | 3 | # https://github.com/AcademySoftwareFoundation/OpenImageIO |
4 | 4 |
|
5 | 5 | if (Libheif_FOUND) |
6 | | - if (LINKSTATIC) |
7 | | - set (_static_suffixes .lib .a) |
8 | | - set (_static_libraries_found 0) |
9 | | - |
10 | | - foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) |
11 | | - get_filename_component (_ext ${_libeheif_library} LAST_EXT) |
12 | | - list (FIND _static_suffixes ${_ext} _index) |
13 | | - if (${_index} GREATER -1) |
14 | | - MATH (EXPR _static_libraries_found "${static_libraries_found}+1") |
15 | | - endif() |
16 | | - endforeach() |
17 | | - |
18 | | - if (${_static_libraries_found} GREATER 0) |
19 | | - message (STATUS "${ColorYellow}") |
20 | | - message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") |
21 | | - message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") |
22 | | - message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") |
23 | | - message (STATUS "dynamically-linked libheif.") |
24 | | - message ("${ColorReset}") |
| 6 | + # Some extra care is needed if the libheif we found was static |
| 7 | + set (_static_suffixes .lib .a) |
| 8 | + set (_static_libraries_found 0) |
| 9 | + foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES) |
| 10 | + get_filename_component (_ext ${_libeheif_library} LAST_EXT) |
| 11 | + list (FIND _static_suffixes ${_ext} _index) |
| 12 | + if (${_index} GREATER -1) |
| 13 | + MATH (EXPR _static_libraries_found "${_static_libraries_found}+1") |
25 | 14 | endif() |
| 15 | + endforeach() |
| 16 | + if (${_static_libraries_found} GREATER 0) |
| 17 | + message (STATUS "${ColorYellow}") |
| 18 | + message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL") |
| 19 | + message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend") |
| 20 | + message (STATUS "that you review the libheif license terms, or you may wish to switch to using a") |
| 21 | + message (STATUS "dynamically-linked libheif.") |
| 22 | + message ("${ColorReset}") |
26 | 23 | endif() |
27 | 24 |
|
28 | 25 | add_oiio_plugin (heifinput.cpp heifoutput.cpp |
29 | | - INCLUDE_DIRS ${LIBHEIF_INCLUDES} |
30 | | - LINK_LIBRARIES ${LIBHEIF_LIBRARIES} |
| 26 | + LINK_LIBRARIES heif |
31 | 27 | DEFINITIONS "USE_HEIF=1") |
32 | 28 | else () |
33 | 29 | message (WARNING "heif plugin will not be built") |
|
0 commit comments