diff options
| author | codicodi <rob.ceglinski@gmail.com> | 2017-07-21 16:45:25 +0200 |
|---|---|---|
| committer | codicodi <rob.ceglinski@gmail.com> | 2017-07-23 20:36:32 +0200 |
| commit | ddffe31def3d32dfdf65ef004e7c48092daf6da4 (patch) | |
| tree | d5e7680779c45bcd02bc53929f34eea1a3a0d05f | |
| parent | f4817ead064872417e4f5e81a94bf8ecb2c6a865 (diff) | |
| download | vcpkg-ddffe31def3d32dfdf65ef004e7c48092daf6da4.tar.gz vcpkg-ddffe31def3d32dfdf65ef004e7c48092daf6da4.zip | |
[libopusenc] initial commit
| -rw-r--r-- | ports/libopusenc/CMakeLists.txt | 38 | ||||
| -rw-r--r-- | ports/libopusenc/CONTROL | 4 | ||||
| -rw-r--r-- | ports/libopusenc/portfile.cmake | 29 |
3 files changed, 71 insertions, 0 deletions
diff --git a/ports/libopusenc/CMakeLists.txt b/ports/libopusenc/CMakeLists.txt new file mode 100644 index 000000000..10f425821 --- /dev/null +++ b/ports/libopusenc/CMakeLists.txt @@ -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() diff --git a/ports/libopusenc/CONTROL b/ports/libopusenc/CONTROL new file mode 100644 index 000000000..8f1ebb9ed --- /dev/null +++ b/ports/libopusenc/CONTROL @@ -0,0 +1,4 @@ +Source: libopusenc +Version: 0.1 +Description: Library for encoding .opus audio files and live streams. +Build-Depends: opus diff --git a/ports/libopusenc/portfile.cmake b/ports/libopusenc/portfile.cmake new file mode 100644 index 000000000..d41880e01 --- /dev/null +++ b/ports/libopusenc/portfile.cmake @@ -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) |
