Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added QDBM addon to CMake build system

  • Loading branch information...
commit dbefa0e34e4e9e6ef36ed67bd9a614609ec5e5c0 1 parent 2f9c5ea
@jeremytregunna jeremytregunna authored
View
2  addons/CMakeLists.txt
@@ -81,7 +81,7 @@ add_subdirectory(Ogg)
add_subdirectory(PostgreSQL)
#add_subdirectory(Postgres)
add_subdirectory(Python)
-#add_subdirectory(QDBM)
+add_subdirectory(QDBM)
add_subdirectory(Random)
add_subdirectory(Range)
add_subdirectory(Rational)
View
40 addons/QDBM/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the QDBM addon
+
+# Find qdbm
+find_package(QDBM)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find qdbm? if so, set up the targets and all the support
+# variables.
+if(QDBM_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(${QDBM_INCLUDE_DIR})
+
+ # Generate the IoQDBMInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(QDBM)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoQDBM.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoQDBMInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoQDBM SHARED ${SRCS})
+ add_dependencies(IoQDBM iovmall)
+ target_link_libraries(IoQDBM iovmall ${QDBM_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/QDBM)
+endif(QDBM_FOUND)
View
23 modules/FindQDBM.cmake
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libqdbm.
+
+FIND_PATH(QDBM_INCLUDE_DIR depot.h cabin.h villa.h)
+
+SET(QDBM_NAMES ${QDBM_NAMES} qdbm libqdbm)
+FIND_LIBRARY(QDBM_LIBRARY NAMES ${QDBM_NAMES} PATH)
+
+IF(QDBM_INCLUDE_DIR AND QDBM_LIBRARY)
+ SET(QDBM_FOUND TRUE)
+ENDIF(QDBM_INCLUDE_DIR AND QDBM_LIBRARY)
+
+IF(QDBM_FOUND)
+ IF(NOT QDBM_FIND_QUIETLY)
+ MESSAGE(STATUS "Found QDBM: ${QDBM_LIBRARY}")
+ ENDIF (NOT QDBM_FIND_QUIETLY)
+ELSE(QDBM_FOUND)
+ IF(QDBM_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find qdbm")
+ ENDIF(QDBM_FIND_REQUIRED)
+ENDIF (QDBM_FOUND)
Please sign in to comment.
Something went wrong with that request. Please try again.