mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 11:07:10 +01:00
[libopusenc] initial commit
This commit is contained in:
parent
f4817ead06
commit
ddffe31def
38
ports/libopusenc/CMakeLists.txt
Normal file
38
ports/libopusenc/CMakeLists.txt
Normal file
@ -0,0 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
project(libopusenc C)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244 /wd4996 /wd4101 /wd4018")
|
||||
|
||||
find_path(OPUS_INCLUDE_DIR opus.h PATH_SUFFIXES opus)
|
||||
find_library(OPUS_LIBRARY opus)
|
||||
|
||||
add_library(opusenc
|
||||
src/ogg_packer.c
|
||||
src/opus_header.c
|
||||
src/opusenc.c
|
||||
src/picture.c
|
||||
src/resample.c)
|
||||
|
||||
get_filename_component(FOLDER ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
string(REPLACE "libopusenc-" "" VERSION ${FOLDER})
|
||||
|
||||
target_compile_definitions(opusenc PRIVATE
|
||||
RANDOM_PREFIX=libopusenc
|
||||
OUTSIDE_SPEEX
|
||||
FLOATING_POINT
|
||||
PACKAGE_VERSION="${VERSION}"
|
||||
PACKAGE_NAME="libopusenc"
|
||||
OPE_BUILD)
|
||||
set_target_properties(opusenc PROPERTIES DEFINE_SYMBOL DLL_EXPORT)
|
||||
target_include_directories(opusenc PRIVATE include ${OPUS_INCLUDE_DIR})
|
||||
target_link_libraries(opusenc PRIVATE ${OPUS_LIBRARY})
|
||||
|
||||
install(TARGETS opusenc
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
||||
if(NOT OPUSENC_SKIP_HEADERS)
|
||||
install(FILES include/opusenc.h
|
||||
DESTINATION include/opus)
|
||||
endif()
|
4
ports/libopusenc/CONTROL
Normal file
4
ports/libopusenc/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: libopusenc
|
||||
Version: 0.1
|
||||
Description: Library for encoding .opus audio files and live streams.
|
||||
Build-Depends: opus
|
29
ports/libopusenc/portfile.cmake
Normal file
29
ports/libopusenc/portfile.cmake
Normal file
@ -0,0 +1,29 @@
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
||||
message(FATAL_ERROR "UWP builds not supported")
|
||||
endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO xiph/libopusenc
|
||||
REF v0.1
|
||||
SHA512 6abc5cd9e87ad41409f844d350cf43ee0067ad05a768aa9ef1d726a7e98ef9b006cbc42a6601d05a51dba6386a1361751a9a367a902c52eff8b4e56c3bf8a04b
|
||||
HEAD_REF master)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DOPUSENC_SKIP_HEADERS=ON)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# make includes work with MSBuild integration
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/include/opus/opusenc.h OPUSENC_H)
|
||||
string(REPLACE "#include <opus.h>" "#include \"opus.h\"" OPUSENC_H "${OPUSENC_H}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/include/opus/opusenc.h "${OPUSENC_H}")
|
||||
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopusenc)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libopusenc/COPYING ${CURRENT_PACKAGES_DIR}/share/libopusenc/copyright)
|
Loading…
x
Reference in New Issue
Block a user