theora icon indicating copy to clipboard operation
theora copied to clipboard

CMake build

Open hsdk123 opened this issue 6 years ago • 3 comments

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.

hsdk123 avatar Jan 20 '20 15:01 hsdk123

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)

jhasse avatar Feb 27 '20 10:02 jhasse

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

hsdk123 avatar Apr 05 '20 08:04 hsdk123