aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/libtheora/CMakeLists.txt68
-rw-r--r--ports/libtheora/CONTROL4
-rw-r--r--ports/libtheora/FindOGG.cmake8
-rw-r--r--ports/libtheora/portfile.cmake32
4 files changed, 112 insertions, 0 deletions
diff --git a/ports/libtheora/CMakeLists.txt b/ports/libtheora/CMakeLists.txt
new file mode 100644
index 000000000..a13c5a8e6
--- /dev/null
+++ b/ports/libtheora/CMakeLists.txt
@@ -0,0 +1,68 @@
+project(theora)
+
+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_directories("include")
+include_directories(${OGG_INCLUDE_DIR})
+
+file(GLOB SOURCES
+"lib/analyze.c"
+"lib/encapiwrapper.c"
+"lib/encfrag.c"
+"lib/encinfo.c"
+"lib/encode.c"
+#"lib/encoder_disabled.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/x86cpu.c"
+"lib/x86_vc/x86enc.c"
+"lib/apiwrapper.c"
+"lib/bitpack.c"
+"lib/decapiwrapper.c"
+"lib/decinfo.c"
+"lib/decode.c"
+"lib/dequant.c"
+"lib/fragment.c"
+"lib/huffdec.c"
+"lib/idct.c"
+"lib/info.c"
+"lib/internal.c"
+"lib/quant.c"
+"lib/state.c"
+"lib/x86_vc/mmxfrag.c"
+"lib/x86_vc/mmxidct.c"
+"lib/x86_vc/mmxstate.c"
+"lib/x86_vc/x86state.c"
+"win32/xmingw32/libtheoradec-all.def"
+)
+
+add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_BIND_TO_CURRENT_CRT_VERSION)
+if (${BUILD_SHARED_LIBS})
+ add_definitions(-DLIBTHEORA_EXPORTS)
+endif()
+
+add_library(theora ${SOURCES} ${HEADERS})
+target_link_libraries(theora ${OGG_LIBRARY})
+
+install(FILES ${HEADERS} DESTINATION include/theora)
+
+install(TARGETS theora
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION bin
+ ARCHIVE DESTINATION lib
+)
diff --git a/ports/libtheora/CONTROL b/ports/libtheora/CONTROL
new file mode 100644
index 000000000..7d373c1cf
--- /dev/null
+++ b/ports/libtheora/CONTROL
@@ -0,0 +1,4 @@
+Source: libtheora
+Version: 1.1.1
+Description: Theora is a free and open video compression format from the Xiph.org Foundation.
+Build-Depends: libogg
diff --git a/ports/libtheora/FindOGG.cmake b/ports/libtheora/FindOGG.cmake
new file mode 100644
index 000000000..fc0d15feb
--- /dev/null
+++ b/ports/libtheora/FindOGG.cmake
@@ -0,0 +1,8 @@
+find_path(OGG_INCLUDE_DIR NAMES ogg/ogg.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR)
+
+mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY)
diff --git a/ports/libtheora/portfile.cmake b/ports/libtheora/portfile.cmake
new file mode 100644
index 000000000..fcaabf44f
--- /dev/null
+++ b/ports/libtheora/portfile.cmake
@@ -0,0 +1,32 @@
+# Common Ambient Variables:
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# TARGET_TRIPLET is the current triplet (x86-windows, etc)
+# PORT is the current port name (zlib, etc)
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+#
+
+include(${CMAKE_TRIPLET_FILE})
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libtheora-1.1.1)
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2"
+ FILENAME "libtheora-1.1.1.tar.bz2"
+ SHA512 9ab9b3af1c35d16a7d6d84f61f59ef3180132e30c27bdd7c0fa2683e0d00e2c791accbc7fd2c90718cc947d8bd10ee4a5940fb55f90f1fd7b0ed30583a47dbbd
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOGG.cmake DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libtheora)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libtheora/LICENSE ${CURRENT_PACKAGES_DIR}/share/libtheora/copyright)