-
Couldn't load subscription status.
- Fork 79
Add cmake support #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 8 commits
e442abc
b5a1ef2
b8aff7f
a4d6b9c
052b0b7
e2987fe
4a0148a
45a1678
4bbc726
d1460ee
6b9748c
bc28f27
2f02dd8
af968a4
9a95948
feac381
67eac2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,3 +82,6 @@ tests/granulepos_theoraenc | |
| tests/noop | ||
| tests/noop_theora | ||
| tests/noop_theoraenc | ||
|
|
||
| .vs/ | ||
| out/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| cmake_minimum_required(VERSION 3.0) | ||
| project(theora LANGUAGES C) | ||
|
|
||
| enable_testing() | ||
|
|
||
| set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}") | ||
| FIND_PACKAGE(Ogg REQUIRED) | ||
|
|
||
| file(GLOB HEADERS | ||
| "include/theora/codec.h" | ||
| "include/theora/theora.h" | ||
| "include/theora/theoradec.h" | ||
| "include/theora/theoraenc.h" | ||
| ) | ||
|
|
||
| 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" | ||
|
|
||
| "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" | ||
| ) | ||
|
|
||
| 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" | ||
|
|
||
| "lib/x86_vc/mmxencfrag.c" | ||
| "lib/x86_vc/mmxfdct.c" | ||
| "lib/x86_vc/x86enc.c" | ||
| ) | ||
|
|
||
| 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() | ||
|
|
||
| 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> "win32/xmingw32/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(theora-config.cmake.in theora-config.cmake | ||
| INSTALL_DESTINATION "lib/theora") | ||
|
|
||
| install(FILES ${HEADERS} DESTINATION include/theora) | ||
|
|
||
| install( | ||
| FILES "${CMAKE_CURRENT_BINARY_DIR}/theora-config.cmake" | ||
| DESTINATION "lib/theora" | ||
| ) | ||
|
|
||
| install(TARGETS theora theoraenc theoradec | ||
| EXPORT theora-targets | ||
| RUNTIME DESTINATION bin | ||
| LIBRARY DESTINATION bin | ||
| ARCHIVE DESTINATION lib | ||
| ) | ||
|
|
||
| install(EXPORT theora-targets | ||
| NAMESPACE theora:: | ||
| DESTINATION "lib/theora" | ||
| ) | ||
|
|
||
| add_subdirectory(tests) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| { | ||
| "configurations": [ | ||
| { | ||
| "name": "x86-Debug", | ||
| "generator": "Ninja", | ||
| "configurationType": "Debug", | ||
| "buildRoot": "${projectDir}\\out\\build\\${name}", | ||
| "installRoot": "${projectDir}\\out\\install\\${name}", | ||
| "cmakeCommandArgs": "", | ||
| "buildCommandArgs": "", | ||
| "ctestCommandArgs": "", | ||
| "inheritEnvironments": [ "msvc_x86" ], | ||
| "variables": [ | ||
| { | ||
| "name": "USE_X86", | ||
| "value": "True", | ||
| "type": "BOOL" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "x86-Release", | ||
| "generator": "Ninja", | ||
| "configurationType": "RelWithDebInfo", | ||
| "buildRoot": "${projectDir}\\out\\build\\${name}", | ||
| "installRoot": "${projectDir}\\out\\install\\${name}", | ||
| "cmakeCommandArgs": "", | ||
| "buildCommandArgs": "", | ||
| "ctestCommandArgs": "", | ||
| "inheritEnvironments": [ "msvc_x86" ], | ||
| "variables": [ | ||
| { | ||
| "name": "USE_X86", | ||
| "value": "True", | ||
| "type": "BOOL" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "x64-Debug", | ||
| "generator": "Ninja", | ||
| "configurationType": "Debug", | ||
| "inheritEnvironments": [ "msvc_x64_x64" ], | ||
| "buildRoot": "${projectDir}\\out\\build\\${name}", | ||
| "installRoot": "${projectDir}\\out\\install\\${name}", | ||
| "cmakeCommandArgs": "", | ||
| "buildCommandArgs": "", | ||
| "ctestCommandArgs": "", | ||
| "variables": [ | ||
| { | ||
| "name": "USE_X86", | ||
| "value": "False", | ||
| "type": "BOOL" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "x64-Release", | ||
| "generator": "Ninja", | ||
| "configurationType": "RelWithDebInfo", | ||
| "buildRoot": "${projectDir}\\out\\build\\${name}", | ||
| "installRoot": "${projectDir}\\out\\install\\${name}", | ||
| "cmakeCommandArgs": "", | ||
| "buildCommandArgs": "", | ||
| "ctestCommandArgs": "", | ||
| "inheritEnvironments": [ "msvc_x64_x64" ], | ||
| "variables": [ | ||
| { | ||
| "name": "USE_X86", | ||
| "value": "False", | ||
| "type": "BOOL" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||
| cmake_minimum_required(VERSION 3.0) | ||||||
|
||||||
| cmake_minimum_required(VERSION 3.0) | |
| cmake_minimum_required(VERSION 3.10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably missed this @mcmtroffaes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for bringing to attention. Yes it looks like I forgot to commit the suggestion, however it seems correct in the final patch (i.e. 3.30 like everywhere else, I settled on that one since this is also what vcpkg is using)?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @PACKAGE_INIT@ | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/theora-targets.cmake") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Uh oh!
There was an error while loading. Please reload this page.