2021-09-19 07:46:47 +02:00
|
|
|
if(NOT WIN32 AND USE_VORBIS)
|
2021-10-22 09:09:33 +02:00
|
|
|
if(NOT VORBIS_PATH)
|
2021-09-19 07:46:47 +02:00
|
|
|
find_package(VorbisFile QUIET)
|
|
|
|
|
|
|
|
if(VORBISFILE_FOUND)
|
|
|
|
set(VORBIS_SOURCE "(system)")
|
|
|
|
endif()
|
|
|
|
endif()
|
2021-10-22 09:09:33 +02:00
|
|
|
if(VORBIS_PATH AND (OGG_PATH OR OGG_FOUND) OR NOT VORBISFILE_FOUND)
|
2021-09-19 07:46:47 +02:00
|
|
|
FetchDependency(VORBIS
|
|
|
|
DIR vorbis
|
|
|
|
GIT_REPOSITORY https://gitlab.xiph.org/xiph/vorbis
|
|
|
|
GIT_TAG v1.3.7
|
|
|
|
)
|
|
|
|
|
2021-10-22 09:09:33 +02:00
|
|
|
if(VORBIS_PATH)
|
2021-10-23 09:48:06 +02:00
|
|
|
set(VORBIS_LINK_PATH ${VORBIS_BIN}/lib/libvorbis.a)
|
|
|
|
set(VORBISFILE_LINK_PATH ${VORBIS_BIN}/lib/libvorbisfile.a)
|
|
|
|
|
|
|
|
if(EXISTS ${VORBIS_LINK_PATH} AND EXISTS ${VORBISFILE_LINK_PATH})
|
|
|
|
add_library(vorbis STATIC IMPORTED)
|
|
|
|
set_target_properties(vorbis PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${VORBIS_LINK_PATH}
|
|
|
|
)
|
|
|
|
add_library(vorbisfile STATIC IMPORTED)
|
|
|
|
set_target_properties(vorbisfile PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${VORBISFILE_LINK_PATH}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_subdirectory(${VORBIS_PATH} ${VORBIS_BIN} EXCLUDE_FROM_ALL)
|
|
|
|
endif()
|
|
|
|
|
2021-09-19 07:46:47 +02:00
|
|
|
set(OGG_VORBIS_INCLUDE_DIR ${VORBIS_PATH}/include)
|
|
|
|
set(OGG_VORBIS_LIBRARY vorbis)
|
|
|
|
|
|
|
|
set(VORBISFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR} ${OGG_VORBIS_INCLUDE_DIR})
|
|
|
|
else()
|
|
|
|
set_vorbis(OFF TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(NOT USE_VORBIS)
|
|
|
|
unset(VORBIS_SOURCE)
|
|
|
|
endif()
|