Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c71756
commit a2d0718
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Base Io build system | ||
# Written by Jeremy Tregunna <jeremy.tregunna@me.com> | ||
# | ||
# Builds the TokyoCabinet addon | ||
|
||
# Find tokyo-cabinet | ||
find_package(TokyoCabinet) | ||
|
||
# Create the _build bundle hierarchy if needed. | ||
make_build_bundle(_build) | ||
|
||
# Did we find tokyo-cabinet? if so, set up the targets and all the support | ||
# variables. | ||
if(TOKYOCABINET_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(${TOKYOCABINET_INCLUDE_DIR}) | ||
|
||
# Generate the IoTokyoCabinetInit.c file. | ||
# Argument SHOULD ALWAYS be the exact name of the addon, case is | ||
# important. | ||
generate_ioinit(TokyoCabinet) | ||
|
||
# Our library sources. | ||
set(SRCS | ||
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoTokyoCabinet.c" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoTokyoCabinetCursor.c" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoTokyoCabinetPrefixCursor.c" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/source/IoTokyoCabinetInit.c" | ||
) | ||
|
||
# Now build the shared library | ||
add_library(IoTokyoCabinet SHARED ${SRCS}) | ||
add_dependencies(IoTokyoCabinet iovmall) | ||
target_link_libraries(IoTokyoCabinet iovmall ${TOKYOCABINET_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/TokyoCabinet) | ||
endif(TOKYOCABINET_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Base Io build system | ||
# Written by Jeremy Tregunna <jeremy.tregunna@me.com> | ||
# | ||
# Find libtokyocabinet. | ||
|
||
FIND_PATH(TOKYOCABINET_INCLUDE_DIR tcutil.h tcbdb.h) | ||
|
||
SET(TOKYOCABINET_NAMES ${TOKYOCABINET_NAMES} tokyocabinet libtokyocabinet) | ||
FIND_LIBRARY(TOKYOCABINET_LIBRARY NAMES ${TOKYOCABINET_NAMES} PATH) | ||
|
||
IF(TOKYOCABINET_INCLUDE_DIR AND TOKYOCABINET_LIBRARY) | ||
SET(TOKYOCABINET_FOUND TRUE) | ||
ENDIF(TOKYOCABINET_INCLUDE_DIR AND TOKYOCABINET_LIBRARY) | ||
|
||
IF(TOKYOCABINET_FOUND) | ||
IF(NOT TokyoCabinet_FIND_QUIETLY) | ||
MESSAGE(STATUS "Found TokyoCabinet: ${TOKYOCABINET_LIBRARY}") | ||
ENDIF (NOT TokyoCabinet_FIND_QUIETLY) | ||
ELSE(TOKYOCABINET_FOUND) | ||
IF(TokyoCabinet_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "Could not find tokyocabinet") | ||
ENDIF(TokyoCabinet_FIND_REQUIRED) | ||
ENDIF (TOKYOCABINET_FOUND) |