Skip to content
This repository
Browse code

Added Yajl to CMake build system.

  • Loading branch information...
commit a23e80a70f5e6a32405bc32f021e8a207bba3ab4 1 parent 556e594
Jeremy Tregunna authored May 07, 2010
8  addons/AVCodec/CMakeLists.txt
@@ -24,6 +24,11 @@ if(FFMPEG_FOUND AND FFMPEG_SWSCALE_FOUND)
24 24
 	# Additional include directories
25 25
 	include_directories(${FFMPEG_INCLUDE_DIR})
26 26
 
  27
+	# Generate the IoAVCodecInit.c file.
  28
+	# Argument SHOULD ALWAYS be the exact name of the addon, case is
  29
+	# important.
  30
+	generate_ioinit(AVCodec)
  31
+
27 32
 	# Our library sources.
28 33
 	file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c")
29 34
 
@@ -33,5 +38,6 @@ if(FFMPEG_FOUND AND FFMPEG_SWSCALE_FOUND)
33 38
 	target_link_libraries(IoAVCodec iovmall ${FFMPEG_LIBRARIES} ${FFMPEG_SWS_LIBRARIES})
34 39
 
35 40
 	# Install the addon to our global addons hierarchy.
36  
-	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
  41
+	install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
  42
+	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/AVCodec)
37 43
 endif(FFMPEG_FOUND AND FFMPEG_SWSCALE_FOUND)
2  addons/CMakeLists.txt
@@ -111,5 +111,5 @@ add_subdirectory(User)
111 111
 #add_subdirectory(VertexDB)
112 112
 #add_subdirectory(Volcano)
113 113
 #add_subdirectory(Vorbis)
114  
-#add_subdirectory(Yajl)
  114
+add_subdirectory(Yajl)
115 115
 #add_subdirectory(Zlib)
37  addons/Yajl/CMakeLists.txt
... ...
@@ -0,0 +1,37 @@
  1
+# Base Io build system
  2
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
  3
+#
  4
+# Builds the Yajl addon
  5
+
  6
+# Find yajl
  7
+find_package(Yajl)
  8
+
  9
+# Create the _build bundle hierarchy if needed.
  10
+make_build_bundle(_build)
  11
+
  12
+# Did we find yajl? if so, set up the targets and all the support
  13
+# variables.
  14
+if(YAJL_FOUND)
  15
+	# Output our dynamic library to the top-level _build hierarchy
  16
+	set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
  17
+
  18
+	# Additional include directories
  19
+	include_directories(${YAJL_INCLUDE_DIR})
  20
+
  21
+	# Generate the IoYajlInit.c file.
  22
+	# Argument SHOULD ALWAYS be the exact name of the addon, case is
  23
+	# important.
  24
+	generate_ioinit(Yajl)
  25
+
  26
+	# Our library sources.
  27
+	file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c")
  28
+
  29
+	# Now build the shared library
  30
+	add_library(IoYajl SHARED ${SRCS})
  31
+	add_dependencies(IoYajl iovmall)
  32
+	target_link_libraries(IoYajl iovmall ${YAJL_LIBRARY})
  33
+
  34
+	# Install the addon to our global addons hierarchy.
  35
+	install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
  36
+	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/Yajl)
  37
+endif(YAJL_FOUND)
23  modules/FindYajl.cmake
... ...
@@ -0,0 +1,23 @@
  1
+# Base Io build system
  2
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
  3
+#
  4
+# Find libyajl
  5
+
  6
+FIND_PATH(YAJL_INCLUDE_DIR yajl/yajl_common.h)
  7
+
  8
+SET(YAJL_NAMES ${YAJL_NAMES} yajl libyajl)
  9
+FIND_LIBRARY(YAJL_LIBRARY NAMES ${YAJL_NAMES} PATH)
  10
+
  11
+IF(YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
  12
+	SET(YAJL_FOUND TRUE)
  13
+ENDIF(YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
  14
+
  15
+IF(YAJL_FOUND)
  16
+	IF(NOT Yajl_FIND_QUIETLY)
  17
+		MESSAGE(STATUS "Found Yajl: ${YAJL_LIBRARY}")
  18
+	ENDIF (NOT Yajl_FIND_QUIETLY)
  19
+ELSE(YAJL_FOUND)
  20
+	IF(Yajl_FIND_REQUIRED)
  21
+		MESSAGE(FATAL_ERROR "Could not find yajl")
  22
+	ENDIF(Yajl_FIND_REQUIRED)
  23
+ENDIF(YAJL_FOUND)

0 notes on commit a23e80a

Please sign in to comment.
Something went wrong with that request. Please try again.