Skip to content

Commit 800b458

Browse files
committed
printing out message with regards to LGPL licensing issues when linking against static versions of ffmpeg and libheif
Signed-off-by: grdanny <danny.gr@gmail.com>
1 parent cfaccc1 commit 800b458

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/ffmpeg.imageio/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
# https://github.com/OpenImageIO/oiio
44

55
if (FFmpeg_FOUND)
6+
if (LINKSTATIC)
7+
set (_static_suffixes .lib .a)
8+
set (_static_libraries_found 0)
9+
10+
foreach (_ffmpeg_library IN LISTS FFMPEG_LIBRARIES)
11+
get_filename_component (_ext ${_ffmpeg_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 FFmpeg, which may have")
21+
message (STATUS "LGPL and possibly GPL licensed components (depending on exactly how your copy")
22+
message (STATUS "of FFmpeg was built). If you intend to redistribute this build of OpenImageIO,")
23+
message (STATUS "we recommend that you review the FFmpeg build flags and licensing terms.")
24+
message ("${ColorReset}")
25+
endif()
26+
endif()
27+
628
add_oiio_plugin (ffmpeginput.cpp
729
INCLUDE_DIRS ${FFMPEG_INCLUDES}
830
LINK_LIBRARIES ${FFMPEG_LIBRARIES}

src/heif.imageio/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
# https://github.com/OpenImageIO/oiio
44

55
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}")
25+
endif()
26+
endif()
27+
628
add_oiio_plugin (heifinput.cpp heifoutput.cpp
729
INCLUDE_DIRS ${LIBHEIF_INCLUDES}
830
LINK_LIBRARIES ${LIBHEIF_LIBRARIES}

0 commit comments

Comments
 (0)