diff options
Diffstat (limited to 'vcpkg/ports/libtheora')
| -rw-r--r-- | vcpkg/ports/libtheora/CMakeLists.txt | 160 | ||||
| -rw-r--r-- | vcpkg/ports/libtheora/libtheora.def | 61 | ||||
| -rw-r--r-- | vcpkg/ports/libtheora/portfile.cmake | 33 | ||||
| -rw-r--r-- | vcpkg/ports/libtheora/unofficial-theora-config.cmake.in | 6 | ||||
| -rw-r--r-- | vcpkg/ports/libtheora/vcpkg.json | 18 |
5 files changed, 278 insertions, 0 deletions
diff --git a/vcpkg/ports/libtheora/CMakeLists.txt b/vcpkg/ports/libtheora/CMakeLists.txt new file mode 100644 index 0000000..b4bf85c --- /dev/null +++ b/vcpkg/ports/libtheora/CMakeLists.txt @@ -0,0 +1,160 @@ +cmake_minimum_required(VERSION 3.30) +project(theora LANGUAGES C) + +set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}") +set(OGG_REQUIRED_VERSION 1.3.4) +find_package(Ogg "${OGG_REQUIRED_VERSION}" CONFIG REQUIRED) + +file(GLOB HEADERS + "include/theora/codec.h" + "include/theora/theora.h" + "include/theora/theoradec.h" + "include/theora/theoraenc.h" +) + +if(MSVC) + set(LIBTHEORA_COMMON_X86 + "lib/x86_vc/mmxfrag.c" + "lib/x86_vc/mmxidct.c" + "lib/x86_vc/mmxstate.c" + "lib/x86_vc/x86cpu.c" + "lib/x86_vc/x86state.c" + ) +else() + set(LIBTHEORA_COMMON_X86 + "lib/x86/mmxfrag.c" + "lib/x86/mmxidct.c" + "lib/x86/mmxstate.c" + "lib/x86/sse2idct.c" + "lib/x86/x86cpu.c" + "lib/x86/x86state.c" + ) +endif() + +set(LIBTHEORA_COMMON + "lib/apiwrapper.c" + "lib/bitpack.c" + "lib/dequant.c" + "lib/fragment.c" + "lib/idct.c" + "lib/info.c" + "lib/internal.c" + "lib/state.c" + "lib/quant.c" + + ${LIBTHEORA_COMMON_X86} +) + +if(MSVC) + set(LIBTHEORA_ENC_X86 + "lib/x86_vc/mmxencfrag.c" + "lib/x86_vc/mmxfdct.c" + "lib/x86_vc/x86enc.c" + ) +else() + set(LIBTHEORA_ENC_X86 + "lib/x86/mmxencfrag.c" + "lib/x86/mmxfdct.c" + "lib/x86/x86enc.c" + "lib/x86/x86enquant.c" + "lib/x86/sse2encfrag.c" + ) +endif() + +set(LIBTHEORA_ENC + "lib/analyze.c" + "lib/encapiwrapper.c" + "lib/encfrag.c" + "lib/encinfo.c" + "lib/encode.c" + "lib/enquant.c" + "lib/fdct.c" + "lib/huffenc.c" + "lib/mathops.c" + "lib/mcenc.c" + "lib/rate.c" + "lib/tokenize.c" + + ${LIBTHEORA_ENC_X86} +) + +set(LIBTHEORA_DEC + "lib/decapiwrapper.c" + "lib/decinfo.c" + "lib/decode.c" + "lib/huffdec.c" +) + +add_definitions(-D_CRT_SECURE_NO_DEPRECATE) +add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + +option(USE_X86 "Use x86 optimization" OFF) +if(USE_X86) + add_definitions(-DOC_X86_ASM) +endif() + +if (BUILD_SHARED_LIBS) + add_definitions(-DLIBTHEORA_EXPORTS) +endif() + +add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS}) +target_link_libraries(theora-common PUBLIC Ogg::ogg) +target_include_directories(theora-common PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) +add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS}) +target_link_libraries(theora-enc PUBLIC Ogg::ogg) +target_include_directories(theora-enc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) +add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS}) +target_link_libraries(theora-dec PUBLIC Ogg::ogg) +target_include_directories(theora-dec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) + +add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def") +target_link_libraries(theora PUBLIC Ogg::ogg) +target_include_directories(theora PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) + +add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def") +target_link_libraries(theoraenc PUBLIC Ogg::ogg) +target_include_directories(theoraenc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) + +add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def") +target_link_libraries(theoradec PUBLIC Ogg::ogg) +target_include_directories(theoradec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) + +include(CMakePackageConfigHelpers) + +configure_package_config_file(unofficial-theora-config.cmake.in unofficial-theora-config.cmake + INSTALL_DESTINATION "lib/unofficial-theora") + +install(FILES ${HEADERS} DESTINATION include/theora) + +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-theora-config.cmake" + DESTINATION "lib/unofficial-theora" +) + +install(TARGETS theora theoraenc theoradec + EXPORT unofficial-theora-targets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +install(EXPORT unofficial-theora-targets + NAMESPACE unofficial::theora:: + DESTINATION "lib/unofficial-theora" +) + +block(SCOPE_FOR VARIABLES) + set(prefix "${CMAKE_INSTALL_PREFIX}") + set(libdir "\${prefix}/lib") + set(exec_prefix "\${prefix}") + set(includedir "\${prefix}/include") + set(THEORA_LIBOGG_REQ_VERSION "${OGG_REQUIRED_VERSION}") + configure_file(theora.pc.in theora.pc @ONLY) + configure_file(theoradec.pc.in theoradec.pc @ONLY) + configure_file(theoraenc.pc.in theoraenc.pc @ONLY) +endblock() + +install( + FILES "${PROJECT_BINARY_DIR}/theora.pc" "${PROJECT_BINARY_DIR}/theoradec.pc" "${PROJECT_BINARY_DIR}/theoraenc.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" +) diff --git a/vcpkg/ports/libtheora/libtheora.def b/vcpkg/ports/libtheora/libtheora.def new file mode 100644 index 0000000..9755b81 --- /dev/null +++ b/vcpkg/ports/libtheora/libtheora.def @@ -0,0 +1,61 @@ +EXPORTS +; Old alpha API + theora_version_string + theora_version_number + theora_decode_header + theora_decode_init + theora_decode_packetin + theora_decode_YUVout + theora_control + theora_packet_isheader + theora_packet_iskeyframe + theora_granule_shift + theora_granule_frame + theora_granule_time + theora_info_init + theora_info_clear + theora_clear + theora_comment_init + theora_comment_add + theora_comment_add_tag + theora_comment_query + theora_comment_query_count + theora_comment_clear +; New theora-exp API + th_version_string + th_version_number + th_decode_headerin + th_decode_alloc + th_setup_free + th_decode_ctl + th_decode_packetin + th_decode_ycbcr_out + th_decode_free + th_packet_isheader + th_packet_iskeyframe + th_granule_frame + th_granule_time + th_info_init + th_info_clear + th_comment_init + th_comment_add + th_comment_add_tag + th_comment_query + th_comment_query_count + th_comment_clear +; Old alpha API + theora_encode_init + theora_encode_YUVin + theora_encode_packetout + theora_encode_header + theora_encode_comment + theora_encode_tables +; New theora-exp API + th_encode_alloc + th_encode_ctl + th_encode_flushheader + th_encode_ycbcr_in + th_encode_packetout + th_encode_free + TH_VP31_QUANT_INFO + TH_VP31_HUFF_CODES diff --git a/vcpkg/ports/libtheora/portfile.cmake b/vcpkg/ports/libtheora/portfile.cmake new file mode 100644 index 0000000..be020f2 --- /dev/null +++ b/vcpkg/ports/libtheora/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO xiph/theora + REF "v${VERSION}" + SHA512 b2aac15528f0ef8258c0902e33e8211e8858c3c7e6e9eeb708cce5922de5f0e412255ddaf540a50c0ebf601df6c4376fd24a0bdd7f8de4432c4ae6e5d6ffe2b6 + HEAD_REF master +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/libtheora.def" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-config.cmake.in" DESTINATION "${SOURCE_PATH}") + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(THEORA_X86_OPT ON) +else() + set(THEORA_X86_OPT OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DVERSION:STRING=${VERSION}" + -DUSE_X86=${THEORA_X86_OPT} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/unofficial-theora" PACKAGE_NAME "unofficial-theora") +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/libtheora/unofficial-theora-config.cmake.in b/vcpkg/ports/libtheora/unofficial-theora-config.cmake.in new file mode 100644 index 0000000..98f152e --- /dev/null +++ b/vcpkg/ports/libtheora/unofficial-theora-config.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +find_dependency(Ogg CONFIG) + +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-targets.cmake") diff --git a/vcpkg/ports/libtheora/vcpkg.json b/vcpkg/ports/libtheora/vcpkg.json new file mode 100644 index 0000000..08410a6 --- /dev/null +++ b/vcpkg/ports/libtheora/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "libtheora", + "version": "1.2.0", + "description": "Theora is a free and open video compression format from the Xiph.org Foundation.", + "homepage": "https://github.com/xiph/theora", + "license": null, + "dependencies": [ + "libogg", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |