forked from weicao/cascadb
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
108 changed files
with
40,850 additions
and
0 deletions.
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
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) | ||
|
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,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}) | ||
|
Oops, something went wrong.