Permalink
Browse files

Added TagLib to CMake build system

  • Loading branch information...
1 parent 897a0bb commit 0dd5b570c8b9849a536f1006d60cae2535de74ca @jeremytregunna jeremytregunna committed May 10, 2010
Showing with 67 additions and 4 deletions.
  1. +4 −4 addons/CMakeLists.txt
  2. +40 −0 addons/TagLib/CMakeLists.txt
  3. +23 −0 modules/FindTagLib.cmake
View
@@ -92,15 +92,15 @@ add_subdirectory(SHA1)
#add_subdirectory(SQLite)
add_subdirectory(SQLite3)
add_subdirectory(SampleRateConverter)
-#add_subdirectory(SecureSocket)
+#add_subdirectory(SecureSocket) # XXX: Broken
#add_subdirectory(SkipDB) # XXX: Disabled...why?
add_subdirectory(Socket)
-#add_subdirectory(SoundTouch)
+#add_subdirectory(SoundTouch) # XXX: I can't meet dependencies
add_subdirectory(SqlDatabase)
add_subdirectory(Syslog)
add_subdirectory(SystemCall)
-#add_subdirectory(TagDB)
-#add_subdirectory(TagLib)
+#add_subdirectory(TagDB) # XXX: I can't meet dependencies
+add_subdirectory(TagLib)
#add_subdirectory(Theora)
#add_subdirectory(Thread)
add_subdirectory(TokyoCabinet)
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the TagLib addon
+
+# Find taglib
+find_package(TagLib)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find taglib? if so, set up the targets and all the support
+# variables.
+if(TAGLIB_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(${TAGLIB_INCLUDE_DIR})
+
+ # Generate the IoTagLibInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(TagLib)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTagLib.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoTagLibInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoTagLib SHARED ${SRCS})
+ add_dependencies(IoTagLib iovmall)
+ target_link_libraries(IoTagLib iovmall ${TAGLIB_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/TagLib)
+endif(TAGLIB_FOUND)
View
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libtaglib.
+
+FIND_PATH(TAGLIB_INCLUDE_DIR taglib/tag_c.h)
+
+SET(TAGLIB_NAMES ${TAGLIB_NAMES} tag_c libtag_c)
+FIND_LIBRARY(TAGLIB_LIBRARY NAMES ${TAGLIB_NAMES} PATH)
+
+IF(TAGLIB_INCLUDE_DIR AND TAGLIB_LIBRARY)
+ SET(TAGLIB_FOUND TRUE)
+ENDIF(TAGLIB_INCLUDE_DIR AND TAGLIB_LIBRARY)
+
+IF(TAGLIB_FOUND)
+ IF(NOT TagLib_FIND_QUIETLY)
+ MESSAGE(STATUS "Found TagLib: ${TAGLIB_LIBRARY}")
+ ENDIF (NOT TagLib_FIND_QUIETLY)
+ELSE(TAGLIB_FOUND)
+ IF(TagLib_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find taglib")
+ ENDIF(TagLib_FIND_REQUIRED)
+ENDIF (TAGLIB_FOUND)

0 comments on commit 0dd5b57

Please sign in to comment.