Skip to content

Commit a37119b

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 a37119b

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

src/ffmpeg.imageio/CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1-
# Copyright 2008-present Contributors to the OpenImageIO project.
2-
# SPDX-License-Identifier: BSD-3-Clause
1+
# Copyright Contributors to the OpenImageIO project.
2+
# SPDX-License-Identifier: Apache-2.0
33
# https://github.com/OpenImageIO/oiio
44

5+
6+
7+
58
if (FFmpeg_FOUND)
9+
if (LINKSTATIC)
10+
set (_static_suffixes .lib .a)
11+
set (_static_libraries_found 0)
12+
13+
foreach (_ffmpeg_library IN LISTS FFMPEG_LIBRARIES)
14+
get_filename_component (_ext ${_ffmpeg_library} LAST_EXT)
15+
list (FIND _static_suffixes ${_ext} _index)
16+
if (${_index} GREATER -1)
17+
MATH (EXPR _static_libraries_found "${_static_libraries_found}+1")
18+
endif()
19+
endforeach()
20+
21+
if (${_static_libraries_found} GREATER 0)
22+
message (STATUS "${ColorYellow}")
23+
message (STATUS "You are linking OpenImageIO against a static version of FFmpeg, which may have")
24+
message (STATUS "LGPL and possibly GPL licensed components (depending on exactly how your copy")
25+
message (STATUS "of FFmpeg was built). If you intend to redistribute this build of OpenImageIO,")
26+
message (STATUS "we recommend that you review the FFmpeg build flags and licensing terms.")
27+
message ("${ColorReset}")
28+
endif()
29+
endif()
30+
631
add_oiio_plugin (ffmpeginput.cpp
732
INCLUDE_DIRS ${FFMPEG_INCLUDES}
833
LINK_LIBRARIES ${FFMPEG_LIBRARIES}

src/heif.imageio/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,30 @@
22
# SPDX-License-Identifier: BSD-3-Clause
33
# https://github.com/OpenImageIO/oiio
44

5+
56
if (Libheif_FOUND)
7+
if (LINKSTATIC)
8+
set (_static_suffixes .lib .a)
9+
set (_static_libraries_found 0)
10+
11+
foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES)
12+
get_filename_component (_ext ${_libeheif_library} LAST_EXT)
13+
list (FIND _static_suffixes ${_ext} _index)
14+
if (${_index} GREATER -1)
15+
MATH (EXPR _static_libraries_found "${static_libraries_found}+1")
16+
endif()
17+
endforeach()
18+
19+
if (${_static_libraries_found} GREATER 0)
20+
message (STATUS "${ColorYellow}")
21+
message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL")
22+
message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend")
23+
message (STATUS "that you review the libheif license terms, or you may wish to switch to using a")
24+
message (STATUS "dynamically-linked libheif.")
25+
message ("${ColorReset}")
26+
endif()
27+
endif()
28+
629
add_oiio_plugin (heifinput.cpp heifoutput.cpp
730
INCLUDE_DIRS ${LIBHEIF_INCLUDES}
831
LINK_LIBRARIES ${LIBHEIF_LIBRARIES}

0 commit comments

Comments
 (0)