Skip to content

Commit d6197ea

Browse files
committed
working
1 parent cf6dbcc commit d6197ea

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

src/ffmpeg.imageio/CMakeLists.txt

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

55
if (FFmpeg_FOUND)
6-
# TODO - remove NOT
7-
if (NOT LINKSTATIC)
6+
if (LINKSTATIC)
87
if (WIN32)
9-
set (STATIC_SUFFIXES .lib .a)
8+
set (_static_suffixes .lib .a)
109
else ()
11-
set (STATIC_SUFFIXES .a .so)
10+
set (_static_suffixes .a)
1211
endif ()
1312

14-
foreach(ffmpeg_library IN LISTS FFMPEG_LIBRARIES)
15-
get_filename_component(_ext ${ffmpeg_library} LAST_EXT) # .txt
16-
list (FIND STATIC_SUFFIXES ${_ext} _index)
13+
set (_static_libraries_found 0)
14+
foreach(_ffmpeg_library IN LISTS FFMPEG_LIBRARIES)
15+
get_filename_component(_ext ${_ffmpeg_library} LAST_EXT)
16+
list (FIND _static_suffixes ${_ext} _index)
1717
if (${_index} GREATER -1)
18-
message(STATUS "found static version of ffmpeg library ${ffmpeg_library}")
19-
message(STATUS "...")
18+
MATH(EXPR _static_libraries_found "${static_libraries_found}+1")
2019
endif()
2120
endforeach()
21+
22+
if (${_static_libraries_found} GREATER 0)
23+
message("${ColorRed}")
24+
message(STATUS "Looks like you are linking against some static ffmpeg libraries: ${FFMPEG_LIBRARIES}")
25+
message(STATUS "ffmpeg is a LGPL-licensed library")
26+
message(STATUS "When linking statically against a LGPL-licensed library your entire project needs to be under LGPL")
27+
message("${ColorReset}")
28+
endif()
29+
2230
endif()
2331

2432

src/heif.imageio/CMakeLists.txt

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

55
if (Libheif_FOUND)
6+
if (LINKSTATIC)
7+
if (WIN32)
8+
set (_static_suffixes .lib .a)
9+
else ()
10+
set (_static_suffixes .a)
11+
endif ()
12+
13+
set (_static_libraries_found 0)
14+
foreach(_libeheif_library IN LISTS LIBHEIF_LIBRARIES)
15+
get_filename_component(_ext ${_libeheif_library} LAST_EXT)
16+
list (FIND _static_suffixes ${_ext} _index)
17+
if (${_index} GREATER -1)
18+
MATH(EXPR _static_libraries_found "${static_libraries_found}+1")
19+
endif()
20+
endforeach()
21+
22+
if (${_static_libraries_found} GREATER 0)
23+
message("${ColorRed}")
24+
message(STATUS "Looks like you are linking against some static libheif libraries")
25+
message(STATUS "libheif is a LGPL-licensed library")
26+
message(STATUS "When linking statically against a LGPL-licensed library your entire project needs to be under LGPL")
27+
message("${ColorReset}")
28+
endif()
29+
30+
endif()
31+
32+
633
add_oiio_plugin (heifinput.cpp heifoutput.cpp
734
INCLUDE_DIRS ${LIBHEIF_INCLUDES}
835
LINK_LIBRARIES ${LIBHEIF_LIBRARIES}

0 commit comments

Comments
 (0)