Skip to content

Commit

Permalink
Upload alpha version
Browse files Browse the repository at this point in the history
  • Loading branch information
weicao committed Mar 18, 2013
1 parent 48b8e44 commit b8df1eb
Show file tree
Hide file tree
Showing 108 changed files with 40,850 additions and 0 deletions.
81 changes: 81 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# author: Wei Cao <[email protected]>

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(cascadb)

set ( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set ( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# set rpath

# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")

add_definitions("-g -O2 -Wall")

# check dependencies

# Check Snappy
include(${CMAKE_SOURCE_DIR}/cmake/FindSnappy.cmake)
if (SNAPPY_FOUND)
message(STATUS "Find snappy include:${SNAPPY_INCLUDE_DIR} libs:${SNAPPY_LIBRARIES}")
add_definitions("-DSNAPPY")
else (SNAPPY_FOUND)
message(WARNING "Cannot find snappy, compression is disabled in cascadb")
endif (SNAPPY_FOUND)

# Check Libaio
include(${CMAKE_SOURCE_DIR}/cmake/FindLibaio.cmake)
if (LIBAIO_FOUND)
message(STATUS "Find libaio include:${LIBAIO_INCLUDE_DIR} libs:${LIBAIO_LIBRARIES}")
add_definitions("-DLIBAIO")
else (LIBAIO_FOUND)
message(WARNING "Cannot find libaio, posix is used instead")
endif (LIBAIO_FOUND)


# Source files

include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src
${SNAPPY_INCLUDE_DIR}
${LIBAIO_INCLUDE_DIR}
)

link_directories(
${PROJECT_SOURCE_DIR}/lib
)

set(CASCADB_LIBS
pthread m rt dl z
${SNAPPY_LIBRARIES}
${LIBAIO_LIBRARIES}
)

MESSAGE(STATUS "Installation path is: ${CMAKE_INSTALL_PREFIX} (overwrite with -DCMAKE_INSTALL_PREFIX=/your/path)")

install(DIRECTORY include/cascadb DESTINATION include)

add_subdirectory(src)
add_subdirectory(bench)
add_subdirectory(thirdparty)

enable_testing()
add_subdirectory(test)

21 changes: 21 additions & 0 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
add_executable(
db_bench
db_bench_cascadb.cpp
testutil.cpp
histogram.cpp)
target_link_libraries(
db_bench
cascadbShared
${CASCADB_LIBS}
)

add_executable(
db_bench_p
db_bench_cascadb_p.cpp
testutil.cpp
histogram.cpp)
target_link_libraries(
db_bench_p
cascadbShared
${CASCADB_LIBS})

Loading

0 comments on commit b8df1eb

Please sign in to comment.