Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print build-time warnings for LGPL gotchas #3958

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/ffmpeg.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
# https://github.com/OpenImageIO/oiio

if (FFmpeg_FOUND)
if (LINKSTATIC)
set (_static_suffixes .lib .a)
set (_static_libraries_found 0)

foreach (_ffmpeg_library IN LISTS FFMPEG_LIBRARIES)
get_filename_component (_ext ${_ffmpeg_library} LAST_EXT)
list (FIND _static_suffixes ${_ext} _index)
if (${_index} GREATER -1)
MATH (EXPR _static_libraries_found "${_static_libraries_found}+1")
endif()
endforeach()

if (${_static_libraries_found} GREATER 0)
message (STATUS "${ColorYellow}")
message (STATUS "You are linking OpenImageIO against a static version of FFmpeg, which may have")
message (STATUS "LGPL and possibly GPL licensed components (depending on exactly how your copy")
message (STATUS "of FFmpeg was built). If you intend to redistribute this build of OpenImageIO,")
message (STATUS "we recommend that you review the FFmpeg build flags and licensing terms.")
message ("${ColorReset}")
endif()
endif()

add_oiio_plugin (ffmpeginput.cpp
INCLUDE_DIRS ${FFMPEG_INCLUDES}
LINK_LIBRARIES ${FFMPEG_LIBRARIES}
Expand Down
22 changes: 22 additions & 0 deletions src/heif.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
# https://github.com/OpenImageIO/oiio

if (Libheif_FOUND)
if (LINKSTATIC)
set (_static_suffixes .lib .a)
set (_static_libraries_found 0)

foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES)
get_filename_component (_ext ${_libeheif_library} LAST_EXT)
list (FIND _static_suffixes ${_ext} _index)
if (${_index} GREATER -1)
MATH (EXPR _static_libraries_found "${static_libraries_found}+1")
endif()
endforeach()

if (${_static_libraries_found} GREATER 0)
message (STATUS "${ColorYellow}")
message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL")
message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend")
message (STATUS "that you review the libheif license terms, or you may wish to switch to using a")
message (STATUS "dynamically-linked libheif.")
message ("${ColorReset}")
endif()
endif()

add_oiio_plugin (heifinput.cpp heifoutput.cpp
INCLUDE_DIRS ${LIBHEIF_INCLUDES}
LINK_LIBRARIES ${LIBHEIF_LIBRARIES}
Expand Down
Loading