diff options
Diffstat (limited to 'vcpkg/ports/libopusenc')
| -rw-r--r-- | vcpkg/ports/libopusenc/CMakeLists.txt | 41 | ||||
| -rw-r--r-- | vcpkg/ports/libopusenc/portfile.cmake | 26 | ||||
| -rw-r--r-- | vcpkg/ports/libopusenc/vcpkg.json | 15 |
3 files changed, 82 insertions, 0 deletions
diff --git a/vcpkg/ports/libopusenc/CMakeLists.txt b/vcpkg/ports/libopusenc/CMakeLists.txt new file mode 100644 index 0000000..442d19a --- /dev/null +++ b/vcpkg/ports/libopusenc/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.4) +project(libopusenc C) + +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244 /wd4996 /wd4101 /wd4018") +endif() + +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 + src/unicode_support.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() diff --git a/vcpkg/ports/libopusenc/portfile.cmake b/vcpkg/ports/libopusenc/portfile.cmake new file mode 100644 index 0000000..1f04d89 --- /dev/null +++ b/vcpkg/ports/libopusenc/portfile.cmake @@ -0,0 +1,26 @@ +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "UWP builds not supported") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO xiph/libopusenc + REF v0.2.1 + SHA512 9681421a967b93770796dd3503c00e1418de86438d2bfe77011dc68f6db5d666508d33c0df7308db3b7ea18f5e1b14a3115fd63837987e16347ec801c3771d26 + HEAD_REF master) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG + -DOPUSENC_SKIP_HEADERS=ON) + +vcpkg_cmake_install() +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(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/libopusenc/vcpkg.json b/vcpkg/ports/libopusenc/vcpkg.json new file mode 100644 index 0000000..81c87ac --- /dev/null +++ b/vcpkg/ports/libopusenc/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "libopusenc", + "version": "0.2.1", + "port-version": 3, + "description": "Library for encoding .opus audio files and live streams.", + "homepage": "https://github.com/xiph/libopusenc", + "supports": "!uwp", + "dependencies": [ + "opus", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |