xiph / theora

Reference implementation of the Theora video compression format.
https://theora.org/
Other
97 stars 64 forks source link

CMake build #10

Open hsdk123 opened 4 years ago

hsdk123 commented 4 years ago

Hi, I see a cmake build option for both ogg and vorbis, but not this great theora library. It would be great to be able to request one.

jhasse commented 4 years ago

This is how I include libtheora in my CMake project:

set(THEORA_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/theora)
if ((NOT EXISTS ${THEORA_SRC_DIR}) OR (NOT EXISTS ${THEORA_SRC_DIR}/CMakeLists.txt))
    execute_process(COMMAND git clone -b v1.1.1
                    https://git.xiph.org/theora.git
                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
endif()
add_library(theoradec OBJECT ${LIBTHEORA_DEC} "${THEORA_SRC_DIR}/lib/apiwrapper.c"
    "${THEORA_SRC_DIR}/lib/bitpack.c" "${THEORA_SRC_DIR}/lib/dequant.c"
    "${THEORA_SRC_DIR}/lib/fragment.c" "${THEORA_SRC_DIR}/lib/idct.c"
    "${THEORA_SRC_DIR}/lib/info.c" "${THEORA_SRC_DIR}/lib/internal.c"
    "${THEORA_SRC_DIR}/lib/state.c" "${THEORA_SRC_DIR}/lib/quant.c"
    "${THEORA_SRC_DIR}/lib/decapiwrapper.c" "${THEORA_SRC_DIR}/lib/decinfo.c"
    "${THEORA_SRC_DIR}/lib/decode.c" "${THEORA_SRC_DIR}/lib/huffdec.c")
target_include_directories(theoradec PRIVATE ${OGG_INCLUDE_DIRS}
    "${THEORA_SRC_DIR}/include")
target_compile_options(theoradec PRIVATE -Wno-shift-negative-value
    -Wno-shift-op-parentheses)
hsdk123 commented 4 years ago

@jhasse Thanks, that works! Would be nice to have an official cmakelists though