Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Theora addon to CMake build system

  • Loading branch information...
commit 5a78e008e065f2cea00ac348438f347639569cf0 1 parent 0dd5b57
@jeremytregunna jeremytregunna authored
View
2  addons/CMakeLists.txt
@@ -101,7 +101,7 @@ add_subdirectory(Syslog)
add_subdirectory(SystemCall)
#add_subdirectory(TagDB) # XXX: I can't meet dependencies
add_subdirectory(TagLib)
-#add_subdirectory(Theora)
+add_subdirectory(Theora)
#add_subdirectory(Thread)
add_subdirectory(TokyoCabinet)
add_subdirectory(Twitter)
View
46 addons/Theora/CMakeLists.txt
@@ -0,0 +1,46 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the Theora addon
+
+# Find theora
+find_package(Theora)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find theora? if so, set up the targets and all the support
+# variables.
+if(THEORA_FOUND)
+ # Output our dynamic library to the top-level _build hierarchy
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+ # Additional include directories
+ include_directories(
+ ${THEORA_INCLUDE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Ogg/source
+ )
+
+ # Generate the IoTheoraInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(Theora)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTheoraComment.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTheoraDecodeContext.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTheoraInfo.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTheoraSetupInfo.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTheoraInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoTheora SHARED ${SRCS})
+ add_dependencies(IoTheora iovmall)
+ target_link_libraries(IoTheora iovmall ${THEORA_LIBRARY} IoOgg)
+
+ # Install the addon to our global addons hierarchy.
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/Theora)
+endif(THEORA_FOUND)
View
1  addons/Theora/Makefile
@@ -1 +0,0 @@
-include ../../Makefile.addon
View
23 modules/FindTheora.cmake
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libtheora.
+
+FIND_PATH(THEORA_INCLUDE_DIR theora/theora.h theora/theoradec.h)
+
+SET(THEORA_NAMES ${THEORA_NAMES} theora libtheora theoradec libtheoradec)
+FIND_LIBRARY(THEORA_LIBRARY NAMES ${THEORA_NAMES} PATH)
+
+IF(THEORA_INCLUDE_DIR AND THEORA_LIBRARY)
+ SET(THEORA_FOUND TRUE)
+ENDIF(THEORA_INCLUDE_DIR AND THEORA_LIBRARY)
+
+IF(THEORA_FOUND)
+ IF(NOT Theora_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Theora: ${THEORA_LIBRARY}")
+ ENDIF (NOT Theora_FIND_QUIETLY)
+ELSE(THEORA_FOUND)
+ IF(Theora_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find theora")
+ ENDIF(Theora_FIND_REQUIRED)
+ENDIF (THEORA_FOUND)
Please sign in to comment.
Something went wrong with that request. Please try again.