Permalink
Browse files

Added ReadLine, Ogg addons to CMake. Also added CMakeLists.txt for LZ…

…O, forgot in last commit.
  • Loading branch information...
1 parent 1124cab commit 85dd2ca7777206a9609e44d642a907076bddd5c3 @jeremytregunna jeremytregunna committed May 8, 2010
@@ -72,11 +72,10 @@ add_subdirectory(Memcached)
#add_subdirectory(MySQL)
#add_subdirectory(NetworkAdapter)
add_subdirectory(NotificationCenter)
-#add_subdirectory(NullAddon)
#add_subdirectory(ODE)
#add_subdirectory(ObjcBridge)
add_subdirectory(Obsidian)
-#add_subdirectory(Ogg)
+add_subdirectory(Ogg)
#add_subdirectory(OpenGL)
#add_subdirectory(PortAudio)
#add_subdirectory(PostgreSQL)
@@ -86,7 +85,7 @@ add_subdirectory(Obsidian)
add_subdirectory(Random)
add_subdirectory(Range)
add_subdirectory(Rational)
-#add_subdirectory(ReadLine)
+add_subdirectory(ReadLine)
add_subdirectory(Regex)
#add_subdirectory(SGML)
add_subdirectory(SHA1)
@@ -0,0 +1,50 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the LZO addon
+
+# Find curses
+find_package(LZO)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find curses? if so, set up the targets and all the support
+# variables.
+if(LZO_FOUND)
+ add_definitions("-DUSE_LIBLZO")
+
+ # Additional include directories
+ include_directories(${LZO_INCLUDE_DIR})
+else()
+ add_definitions("-DUSE_MINILZO")
+endif(LZO_FOUND)
+
+# Output our dynamic library to the top-level _build hierarchy
+set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+# Generate the IoLZOInit.c file.
+# Argument SHOULD ALWAYS be the exact name of the addon, case is
+# important.
+generate_ioinit(LZO)
+
+# Our library sources.
+set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoLZODecoder.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoLZOEncoder.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/minilzo.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoLZOInit.c"
+)
+
+# Now build the shared library
+add_library(IoLZO SHARED ${SRCS})
+add_dependencies(IoLZO iovmall)
+if(LZO_FOUND)
+ target_link_libraries(IoLZO iovmall ${LZO_LIBRARIES})
+else()
+ target_link_libraries(IoLZO iovmall)
+endif(LZO_FOUND)
+
+# 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/LZO)
@@ -0,0 +1,43 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the Ogg addon
+
+# Find libogg
+find_package(Ogg)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find libogg? if so, set up the targets and all the support
+# variables.
+if(OGG_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(${OGG_INCLUDE_DIR})
+
+ # Generate the IoOggInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(Ogg)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoOggPacket.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoOggPage.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoOggStreamState.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoOggSyncState.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoOggInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoOgg SHARED ${SRCS})
+ add_dependencies(IoOgg iovmall)
+ target_link_libraries(IoOgg iovmall ${OGG_LIBRARY})
+
+ # 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/Ogg)
+endif(OGG_FOUND)
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the ReadLine addon
+
+# Find readline
+find_package(ReadLine)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find readline? if so, set up the targets and all the support
+# variables.
+if(READLINE_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(${READLINE_INCLUDE_DIR})
+
+ # Generate the IoReadLineInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(ReadLine)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoReadLine.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoReadLineInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoReadLine SHARED ${SRCS})
+ add_dependencies(IoReadLine iovmall)
+ target_link_libraries(IoReadLine iovmall ${READLINE_LIBRARY})
+
+ # 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/ReadLine)
+endif(READLINE_FOUND)
View
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libogg.
+
+FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h)
+
+SET(OGG_NAMES ${OGG_NAMES} ogg libogg)
+FIND_LIBRARY(OGG_LIBRARY NAMES ${OGG_NAMES} PATH)
+
+IF(OGG_INCLUDE_DIR AND OGG_LIBRARY)
+ SET(OGG_FOUND TRUE)
+ENDIF(OGG_INCLUDE_DIR AND OGG_LIBRARY)
+
+IF(OGG_FOUND)
+ IF(NOT Ogg_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}")
+ ENDIF (NOT Ogg_FIND_QUIETLY)
+ELSE(OGG_FOUND)
+ IF(Ogg_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find ogg")
+ ENDIF(Ogg_FIND_REQUIRED)
+ENDIF (OGG_FOUND)
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libreadline.
+
+FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h readline/history.h)
+
+SET(READLINE_NAMES ${READLINE_NAMES} readline libreadline history libhistory)
+FIND_LIBRARY(READLINE_LIBRARY NAMES ${READLINE_NAMES} PATH)
+
+IF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND TRUE)
+ENDIF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+
+IF(READLINE_FOUND)
+ IF(NOT Readline_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Readline: ${READLINE_LIBRARY}")
+ ENDIF (NOT Readline_FIND_QUIETLY)
+ELSE(READLINE_FOUND)
+ IF(Readline_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find readline")
+ ENDIF(Readline_FIND_REQUIRED)
+ENDIF (READLINE_FOUND)

0 comments on commit 85dd2ca

Please sign in to comment.