vcpkg/ports/libtheora/CMakeLists.txt

93 lines
2.2 KiB
CMake
Raw Normal View History

2017-07-27 09:47:59 +08:00
cmake_minimum_required(VERSION 3.0)
project(theora LANGUAGES C)
2016-10-31 00:09:18 +08:00
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
FIND_PACKAGE(OGG REQUIRED)
file(GLOB HEADERS
2017-07-27 09:47:59 +08:00
"include/theora/codec.h"
"include/theora/theora.h"
"include/theora/theoradec.h"
"include/theora/theoraenc.h"
2016-10-31 00:09:18 +08:00
)
include_directories("include")
include_directories(${OGG_INCLUDE_DIR})
2017-07-27 09:47:59 +08:00
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"
2016-10-31 00:09:18 +08:00
)
2017-07-27 09:47:59 +08:00
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()
2016-10-31 00:09:18 +08:00
if (${BUILD_SHARED_LIBS})
2017-07-27 09:47:59 +08:00
add_definitions(-DLIBTHEORA_EXPORTS)
2016-10-31 00:09:18 +08:00
endif()
2017-07-27 09:47:59 +08:00
add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS})
add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS})
add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS})
add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def")
2016-10-31 00:09:18 +08:00
target_link_libraries(theora ${OGG_LIBRARY})
2017-07-27 09:47:59 +08:00
add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def")
target_link_libraries(theoraenc ${OGG_LIBRARY})
add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def")
target_link_libraries(theoradec ${OGG_LIBRARY})
2016-10-31 00:09:18 +08:00
install(FILES ${HEADERS} DESTINATION include/theora)
2017-07-27 09:47:59 +08:00
install(TARGETS theora theoraenc theoradec
2016-10-31 00:09:18 +08:00
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib
)