aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libopusenc/CMakeLists.txt
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libopusenc/CMakeLists.txt
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libopusenc/CMakeLists.txt')
-rw-r--r--vcpkg/ports/libopusenc/CMakeLists.txt41
1 files changed, 41 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()