Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added UUID addon

  • Loading branch information...
commit 30b6e559cc181f00907ed26e479892a55aa84510 1 parent 95fc888
@jeremytregunna jeremytregunna authored
View
2  addons/CMakeLists.txt
@@ -105,7 +105,7 @@ add_subdirectory(SystemCall)
#add_subdirectory(Thread)
#add_subdirectory(TokyoCabinet)
add_subdirectory(Twitter)
-#add_subdirectory(UUID)
+add_subdirectory(UUID)
add_subdirectory(User)
#add_subdirectory(VertexDB)
#add_subdirectory(Volcano)
View
40 addons/UUID/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the UUID addon
+
+# Find uuid
+find_package(UUID)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find uuid? if so, set up the targets and all the support
+# variables.
+if(UUID_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(${UUID_INCLUDE_DIR})
+
+ # Generate the IoUUIDInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(UUID)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoUUID.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoUUIDInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoUUID SHARED ${SRCS})
+ add_dependencies(IoUUID iovmall)
+ target_link_libraries(IoUUID iovmall)
+
+ # 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/UUID)
+endif(UUID_FOUND)
View
16 modules/FindUUID.cmake
@@ -0,0 +1,16 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libuuid
+
+FIND_PATH(UUID_INCLUDE_DIR uuid/uuid.h)
+
+IF(UUID_INCLUDE_DIR)
+ SET(UUID_FOUND TRUE)
+ENDIF(UUID_INCLUDE_DIR)
+
+IF(NOT UUID_FOUND)
+ IF(UUID_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find UUID")
+ ENDIF(UUID_FIND_REQUIRED)
+ENDIF(NOT UUID_FOUND)
Please sign in to comment.
Something went wrong with that request. Please try again.