Skip to content

Commit

Permalink
FindVorbis: Link ogg in static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Nov 12, 2023
1 parent 81ba008 commit 371f78c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmake/modules/FindVorbis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The following cache variables may also be set:

#]=======================================================================]

include(IsStaticLibrary)

find_path(Vorbis_vorbis_INCLUDE_DIR
NAMES vorbis/codec.h
DOC "Vorbis include directory"
Expand Down Expand Up @@ -96,6 +98,18 @@ foreach(component ${Vorbis_FIND_COMPONENTS})
endif()
endforeach()

if(Vorbis_vorbis_FOUND)
is_static_library(Vorbis_vorbis_IS_STATIC Vorbis::vorbis)
if(Vorbis_vorbis_IS_STATIC)
find_package(Ogg)
if(Ogg_FOUND)
set_property(TARGET Vorbis::vorbis APPEND PROPERTY INTERFACE_LINK_LIBRARIES
Ogg::ogg
)
endif()
endif()
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Vorbis
REQUIRED_VARS Vorbis_vorbis_INCLUDE_DIR Vorbis_vorbis_LIBRARY
Expand Down

0 comments on commit 371f78c

Please sign in to comment.