2016-06-05 20:30:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2016-05-16 04:43:42 +08:00
|
|
|
|
|
|
|
# get directory name
|
2016-12-16 21:05:04 +08:00
|
|
|
get_filename_component(project_name ${CMAKE_SOURCE_DIR} NAME)
|
2016-05-16 04:43:42 +08:00
|
|
|
# replace whitespaces with underscores
|
2016-12-16 21:05:04 +08:00
|
|
|
string(REPLACE " " "_" project_name ${project_name})
|
2016-05-16 04:43:42 +08:00
|
|
|
# set project name
|
2016-12-16 21:05:04 +08:00
|
|
|
project(${project_name})
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2016-11-19 00:35:29 +08:00
|
|
|
# setup CMake module path, defines path for include() and find_package()
|
|
|
|
# https://cmake.org/cmake/help/latest/variable/CMAKE_MODULE_PATH.html
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
|
2016-06-26 00:26:26 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2016-08-01 01:58:12 +08:00
|
|
|
# flags
|
2016-08-08 16:32:34 +08:00
|
|
|
|
2016-05-25 06:37:14 +08:00
|
|
|
# c++14
|
2016-12-16 21:05:04 +08:00
|
|
|
set(cxx_standard 14)
|
2016-05-25 06:37:14 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
|
2016-08-08 16:32:34 +08:00
|
|
|
|
2016-05-25 06:37:14 +08:00
|
|
|
# functions
|
|
|
|
|
2016-06-07 05:57:16 +08:00
|
|
|
# prints all included directories
|
2016-05-25 06:37:14 +08:00
|
|
|
function(list_includes)
|
2016-06-07 05:57:16 +08:00
|
|
|
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES)
|
2016-05-25 06:37:14 +08:00
|
|
|
foreach(dir ${dirs})
|
|
|
|
message(STATUS "dir='${dir}'")
|
|
|
|
endforeach()
|
|
|
|
endfunction(list_includes)
|
|
|
|
|
2016-06-07 05:57:16 +08:00
|
|
|
# get file names from list of file paths
|
|
|
|
function(get_file_names file_paths file_names)
|
|
|
|
set(file_names "")
|
|
|
|
foreach(file_path ${file_paths})
|
|
|
|
get_filename_component (file_name ${file_path} NAME_WE)
|
|
|
|
list(APPEND file_names ${file_name})
|
|
|
|
endforeach()
|
|
|
|
set(file_names "${file_names}" PARENT_SCOPE)
|
|
|
|
endfunction()
|
|
|
|
|
2016-06-27 06:43:28 +08:00
|
|
|
MACRO(SUBDIRLIST result curdir)
|
|
|
|
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
|
|
|
SET(dirlist "")
|
|
|
|
FOREACH(child ${children})
|
|
|
|
IF(IS_DIRECTORY ${curdir}/${child})
|
|
|
|
LIST(APPEND dirlist ${child})
|
|
|
|
ENDIF()
|
|
|
|
ENDFOREACH()
|
|
|
|
SET(${result} ${dirlist})
|
|
|
|
ENDMACRO()
|
|
|
|
|
2016-05-29 03:18:26 +08:00
|
|
|
# custom targets
|
|
|
|
|
2016-06-03 22:48:23 +08:00
|
|
|
# move test data data to the build directory
|
2016-05-29 03:18:26 +08:00
|
|
|
if (UNIX)
|
2016-06-03 22:48:23 +08:00
|
|
|
set(test_data "tests/data")
|
|
|
|
set(test_data_src "${CMAKE_SOURCE_DIR}/${test_data}")
|
|
|
|
set(test_data_dst "${CMAKE_BINARY_DIR}/${test_data}")
|
2016-05-29 03:18:26 +08:00
|
|
|
add_custom_target (test_data
|
|
|
|
COMMAND rm -rf ${test_data_dst}
|
|
|
|
COMMAND cp -r ${test_data_src} ${test_data_dst}
|
|
|
|
)
|
|
|
|
endif (UNIX)
|
|
|
|
|
2016-05-23 13:51:36 +08:00
|
|
|
# external dependencies
|
|
|
|
|
2016-05-29 03:18:26 +08:00
|
|
|
set(src_dir ${CMAKE_SOURCE_DIR}/src)
|
|
|
|
set(libs_dir ${CMAKE_SOURCE_DIR}/libs)
|
2016-07-11 09:39:33 +08:00
|
|
|
set(include_dir ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
set(build_include_dir ${CMAKE_BINARY_DIR}/include)
|
|
|
|
set(test_include_dir ${CMAKE_BINARY_DIR}/tests/include)
|
|
|
|
set(test_src_dir ${CMAKE_BINARY_DIR}/tests/src)
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2016-06-26 00:26:26 +08:00
|
|
|
# setup external dependencies
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2016-06-26 00:26:26 +08:00
|
|
|
# !! IMPORTANT !! run ./libs/setup.sh before cmake command
|
|
|
|
# TODO: run from execute_process
|
|
|
|
|
|
|
|
# lemon & lempar
|
|
|
|
set(lemon_dir ${libs_dir}/lemon)
|
|
|
|
# lexertl
|
|
|
|
set(lexertl_dir ${libs_dir}/lexertl)
|
|
|
|
# fmt
|
|
|
|
set(fmt_source_dir ${libs_dir}/fmt)
|
|
|
|
set(fmt_static_lib ${fmt_source_dir}/fmt/libfmt.a)
|
2016-09-05 08:35:52 +08:00
|
|
|
# yaml-cpp
|
|
|
|
set(yaml_source_dir ${libs_dir}/yaml-cpp)
|
2016-12-04 17:20:14 +08:00
|
|
|
set(yaml_include_dir ${yaml_source_dir}/include)
|
2016-09-05 08:35:52 +08:00
|
|
|
set(yaml_static_lib ${yaml_source_dir}/libyaml-cpp.a)
|
2016-06-26 00:26:26 +08:00
|
|
|
# Catch (C++ Automated Test Cases in Headers)
|
|
|
|
set(catch_source_dir "${libs_dir}/Catch")
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2016-11-19 00:35:29 +08:00
|
|
|
# load cmake modules: cmake/*.cmake
|
2016-11-29 11:08:08 +08:00
|
|
|
include(gtest)
|
2016-11-19 00:35:29 +08:00
|
|
|
include(gbenchmark)
|
|
|
|
|
2016-05-25 06:37:14 +08:00
|
|
|
# build memgraph's cypher grammar
|
2016-05-29 03:18:26 +08:00
|
|
|
# copy grammar file to the build directory
|
2016-11-02 23:05:02 +08:00
|
|
|
FILE(COPY ${include_dir}/query/language/cypher/cypher.y DESTINATION ${CMAKE_BINARY_DIR})
|
2016-05-29 03:18:26 +08:00
|
|
|
# build cypher parser (only c file - cypher.c)
|
2016-05-23 13:51:36 +08:00
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND ${lemon_dir}/lemon ${CMAKE_BINARY_DIR}/cypher.y -s
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
2016-05-29 03:18:26 +08:00
|
|
|
# change cypher parser c extension to cpp (cypher.c -> cypher.cpp)
|
2016-05-23 13:51:36 +08:00
|
|
|
FILE(RENAME ${CMAKE_BINARY_DIR}/cypher.c ${CMAKE_BINARY_DIR}/cypher.cpp)
|
2016-05-29 03:18:26 +08:00
|
|
|
# add include file (cypher.h) to build include dir
|
|
|
|
SET(cypher_build_include_dir ${build_include_dir}/cypher)
|
|
|
|
FILE(MAKE_DIRECTORY ${cypher_build_include_dir})
|
|
|
|
FILE(RENAME ${CMAKE_BINARY_DIR}/cypher.h ${cypher_build_include_dir}/cypher.h)
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2016-07-11 09:39:33 +08:00
|
|
|
# prepare template and destination folders for query engine (tests)
|
2016-08-10 16:39:02 +08:00
|
|
|
# and memgraph server binary
|
2016-06-27 06:43:28 +08:00
|
|
|
# copy query_engine's templates file
|
2016-07-11 09:39:33 +08:00
|
|
|
FILE(COPY ${src_dir}/query_engine/template DESTINATION ${CMAKE_BINARY_DIR}/tests)
|
2016-08-10 16:39:02 +08:00
|
|
|
FILE(COPY ${src_dir}/query_engine/template DESTINATION ${CMAKE_BINARY_DIR})
|
2016-06-27 06:43:28 +08:00
|
|
|
# create destination folder for compiled queries
|
2016-07-11 09:39:33 +08:00
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/compiled/cpu)
|
2016-08-10 16:39:02 +08:00
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/compiled/cpu)
|
2016-06-27 06:43:28 +08:00
|
|
|
|
|
|
|
# TODO: filter header files, all files don't need to be copied
|
2016-07-03 08:02:42 +08:00
|
|
|
# they are all copied because query engine needs header files during
|
|
|
|
# query compilation
|
2016-07-11 09:39:33 +08:00
|
|
|
# TODO: make a function (REMOVE copy pasted part)
|
2016-08-10 16:39:02 +08:00
|
|
|
# SUBDIRLIST(source_folders ${src_dir})
|
|
|
|
# foreach(source_folder ${source_folders})
|
|
|
|
# file(COPY ${src_dir}/${source_folder} DESTINATION ${build_include_dir})
|
|
|
|
# endforeach()
|
2016-07-11 09:39:33 +08:00
|
|
|
SUBDIRLIST(source_folders ${src_dir})
|
|
|
|
foreach(source_folder ${source_folders})
|
|
|
|
file(COPY ${src_dir}/${source_folder} DESTINATION ${test_src_dir})
|
|
|
|
endforeach()
|
|
|
|
SUBDIRLIST(source_folders ${include_dir})
|
|
|
|
foreach(source_foler ${source_folders})
|
|
|
|
file(COPY ${include_dir}/${source_folder} DESTINATION ${test_include_dir})
|
|
|
|
endforeach()
|
2016-06-27 06:43:28 +08:00
|
|
|
|
2016-11-29 11:08:08 +08:00
|
|
|
include(copy_includes)
|
2016-08-10 16:39:02 +08:00
|
|
|
|
2016-12-02 20:48:14 +08:00
|
|
|
# linter setup (clang-tidy)
|
|
|
|
# all source files for linting
|
|
|
|
FILE(GLOB_RECURSE LINTER_SRC_FILES
|
|
|
|
${src_dir}/*.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/tests/.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/poc/.cpp
|
|
|
|
)
|
|
|
|
MESSAGE(STATUS "All cpp files for linting are: ${LINTER_SRC_FILES}")
|
|
|
|
|
|
|
|
# linter target clang-tidy
|
|
|
|
find_program(CLANG_TIDY "clang-tidy")
|
|
|
|
if(CLANG_TIDY)
|
|
|
|
add_custom_target(
|
|
|
|
clang-tidy
|
|
|
|
COMMAND /usr/bin/clang-tidy
|
|
|
|
${LINTER_SRC_FILES}
|
|
|
|
-config=''
|
|
|
|
--
|
|
|
|
-std=c++1y
|
2016-12-04 17:20:14 +08:00
|
|
|
-I${CMAKE_SOURCE_DIR}/include -I${fmt_source_dir} -I${yaml_include_dir}
|
2016-12-02 20:48:14 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
# linter setup
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
# debug flags
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
# set(CMAKE_CXX_FLAGS_DEBUG "-Wl,--export-dynamic ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
|
|
# set(CMAKE_CXX_FLAGS_DEBUG "-rdynamic ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# release flags
|
2016-10-13 21:42:19 +08:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
|
|
|
|
#debug flags
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g2 ${CMAKE_CXX_FLAGS_DEBUG}")
|
2016-08-08 16:32:34 +08:00
|
|
|
|
2016-08-30 08:01:03 +08:00
|
|
|
# TODO: find a way how to applay the defines at the query compile time
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- configure defines -- default is ON | true | enabled ----------------------
|
|
|
|
# -- logging ------------------------------------------------------------------
|
|
|
|
option(LOG_NO_TRACE "Disable trace logging" OFF)
|
|
|
|
message(STATUS "LOG_NO_TRACE: ${LOG_NO_TRACE}")
|
|
|
|
if (LOG_NO_TRACE)
|
|
|
|
add_definitions(-DLOG_NO_TRACE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(LOG_NO_DEBUG "Disable debug logging" OFF)
|
|
|
|
message(STATUS "LOG_NO_DEBUG: ${LOG_NO_DEBUG}")
|
|
|
|
if (LOG_NO_DEBUG)
|
|
|
|
add_definitions(-DLOG_NO_DEBUG)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(LOG_NO_INFO "Disable info logging" OFF)
|
|
|
|
message(STATUS "LOG_NO_INFO: ${LOG_NO_INFO}")
|
|
|
|
if (LOG_NO_INFO)
|
|
|
|
add_definitions(-DLOG_NO_INFO)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(LOG_NO_WARN "Disable warn logging" OFF)
|
|
|
|
message(STATUS "LOG_NO_WARN: ${LOG_NO_WARN}")
|
|
|
|
if (LOG_NO_WARN)
|
|
|
|
add_definitions(-DLOG_NO_WARN)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(LOG_NO_ERROR "Disable error logging" OFF)
|
|
|
|
message(STATUS "LOG_NO_ERROR: ${LOG_NO_ERROR}")
|
|
|
|
if (LOG_NO_ERROR)
|
|
|
|
add_definitions(-DLOG_NO_ERROR)
|
|
|
|
endif()
|
|
|
|
# -- logging ------------------------------------------------------------------
|
2016-08-19 08:28:22 +08:00
|
|
|
# -- logger -------------------------------------------------------------------
|
|
|
|
option(SYNC_LOGGER "" OFF)
|
|
|
|
message(STATUS "SYNC LOGGER: ${SYNC_LOGGER}")
|
|
|
|
if (SYNC_LOGGER)
|
|
|
|
add_definitions(-DSYNC_LOGGER)
|
|
|
|
endif()
|
|
|
|
# -- logger -------------------------------------------------------------------
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- assert -------------------------------------------------------------------
|
|
|
|
option(RUNTIME_ASSERT "Enable runtime assertions" ON)
|
|
|
|
message(STATUS "RUNTIME_ASSERT: ${RUNTIME_ASSERT}")
|
2016-06-15 06:06:21 +08:00
|
|
|
if(RUNTIME_ASSERT)
|
2016-08-11 11:47:30 +08:00
|
|
|
add_definitions(-DRUNTIME_ASSERT_ON)
|
2016-06-15 06:06:21 +08:00
|
|
|
endif()
|
|
|
|
|
2016-08-11 11:47:30 +08:00
|
|
|
option(THROW_EXCEPTION_ON_ERROR "Throw exception on error" ON)
|
|
|
|
message(STATUS "THROW_EXCEPTION_ON_ERROR: ${THROW_EXCEPTION_ON_ERROR}")
|
2016-06-15 06:06:21 +08:00
|
|
|
if(THROW_EXCEPTION_ON_ERROR)
|
2016-08-11 11:47:30 +08:00
|
|
|
add_definitions(-DTHROW_EXCEPTION_ON_ERROR)
|
2016-06-15 06:06:21 +08:00
|
|
|
endif()
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- assert -------------------------------------------------------------------
|
|
|
|
# -- ndebug -------------------------------------------------------------------
|
2016-06-15 06:06:21 +08:00
|
|
|
option(NDEBUG "No debug" OFF)
|
2016-08-11 11:47:30 +08:00
|
|
|
message(STATUS "NDEBUG: ${NDEBUG} (be careful CMAKE_BUILD_TYPE can also append this flag)")
|
2016-06-15 06:06:21 +08:00
|
|
|
if(NDEBUG)
|
|
|
|
add_definitions( -DNDEBUG )
|
|
|
|
endif()
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- ndebug -------------------------------------------------------------------
|
2016-10-13 21:42:19 +08:00
|
|
|
# -- GLIBCXX_DEBUG ------------------------------------------------------------
|
|
|
|
# glibcxx debug (useful for gdb)
|
|
|
|
# the problem is that the query engine doesn't work as it should work if
|
|
|
|
# this flag is present
|
|
|
|
option(GLIBCXX_DEBUG "glibc debug" OFF)
|
|
|
|
message(STATUS "GLIBCXX_DEBUG: ${GLIBCXX_DEBUG} (solves problem with _M_dataplus member during a debugging process")
|
|
|
|
if(GLIBCXX_DEBUG)
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-D_GLIBCXX_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
endif()
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- binaries -----------------------------------------------------------------
|
2016-08-10 16:39:02 +08:00
|
|
|
option(MEMGRAPH "Build memgraph binary" ON)
|
2016-08-11 11:47:30 +08:00
|
|
|
message(STATUS "MEMGRAPH binary: ${MEMGRAPH}")
|
2016-08-10 16:39:02 +08:00
|
|
|
option(POC "Build proof of concept binaries" ON)
|
2016-08-11 11:47:30 +08:00
|
|
|
message(STATUS "POC binaries: ${POC}")
|
2016-08-23 02:03:45 +08:00
|
|
|
option(TOOLS "Build tool executables" ON)
|
|
|
|
message(STATUS "TOOLS binaries: ${TOOLS}")
|
2016-12-16 21:05:04 +08:00
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
option(TESTS "Build test binaries" ON)
|
2016-08-11 11:47:30 +08:00
|
|
|
message(STATUS "TESTS binaries: ${TESTS}")
|
2016-12-16 21:05:04 +08:00
|
|
|
|
|
|
|
option(BENCHMARK "Build benchmark test binaries" ON)
|
|
|
|
message(STATUS "BENCHMARK test binaries: ${BENCHMARK}")
|
|
|
|
option(CONCURRENT "Build concurrent test binaries" ON)
|
|
|
|
message(STATUS "CONCURRENT test binaries: ${CONCURRENT}")
|
|
|
|
option(INTEGRATION "Build integration test binaries" ON)
|
|
|
|
message(STATUS "INTEGRATION test binaries: ${INTEGRATION}")
|
|
|
|
option(MANUAL "Build manual test binaries" ON)
|
|
|
|
message(STATUS "MANUAL test binaries: ${MANUAL}")
|
|
|
|
option(UNIT "Build unit test binaries" ON)
|
|
|
|
message(STATUS "UNIT test binaries: ${UNIT}")
|
2016-08-11 11:47:30 +08:00
|
|
|
# -- binaries -----------------------------------------------------------------
|
|
|
|
# -- configure defines --------------------------------------------------------
|
2016-08-10 16:39:02 +08:00
|
|
|
|
|
|
|
# -- includes -----------------------------------------------------------------
|
2016-07-05 11:01:22 +08:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
2016-05-25 06:37:14 +08:00
|
|
|
include_directories(${src_dir})
|
2016-05-29 03:18:26 +08:00
|
|
|
include_directories(${build_include_dir})
|
2016-06-26 00:26:26 +08:00
|
|
|
include_directories(${fmt_source_dir})
|
2016-12-04 17:20:14 +08:00
|
|
|
include_directories(${yaml_include_dir})
|
2016-06-26 00:26:26 +08:00
|
|
|
include_directories(${http_parser_source_dir})
|
|
|
|
include_directories(${lexertl_dir})
|
|
|
|
include_directories(${libuv_source_dir}/include)
|
|
|
|
include_directories(${rapidjson_source_dir}/include)
|
|
|
|
include_directories(${r3_source_dir}/include)
|
2016-08-10 16:39:02 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-05-25 06:37:14 +08:00
|
|
|
|
2016-05-29 03:18:26 +08:00
|
|
|
# creates build/libcypher_lib.a
|
|
|
|
add_library(cypher_lib STATIC ${CMAKE_BINARY_DIR}/cypher.cpp)
|
2016-05-25 06:37:14 +08:00
|
|
|
|
2016-06-27 06:43:28 +08:00
|
|
|
# REST API preprocessor
|
2016-06-26 00:26:26 +08:00
|
|
|
EXECUTE_PROCESS(
|
|
|
|
COMMAND python link_resources.py
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/api
|
|
|
|
)
|
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
# TODO: create separate static library from bolt code
|
2016-07-07 08:58:26 +08:00
|
|
|
set(memgraph_src_files
|
2016-09-05 08:35:52 +08:00
|
|
|
${src_dir}/config/config.cpp
|
2016-08-30 07:45:07 +08:00
|
|
|
${src_dir}/dbms/dbms.cpp
|
|
|
|
${src_dir}/dbms/cleaner.cpp
|
2016-08-10 16:39:02 +08:00
|
|
|
${src_dir}/utils/string/transform.cpp
|
|
|
|
${src_dir}/utils/string/join.cpp
|
|
|
|
${src_dir}/utils/string/file.cpp
|
2016-09-08 20:25:52 +08:00
|
|
|
${src_dir}/utils/numerics/saturate.cpp
|
2016-08-11 11:47:30 +08:00
|
|
|
${src_dir}/communication/bolt/v1/bolt.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/states.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/session.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/states/error.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/states/executor.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/states/init.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/states/handshake.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/transport/bolt_decoder.cpp
|
|
|
|
${src_dir}/communication/bolt/v1/transport/buffer.cpp
|
2016-08-29 04:10:13 +08:00
|
|
|
${src_dir}/communication/bolt/v1/serialization/bolt_serializer.cpp
|
2016-08-30 07:45:07 +08:00
|
|
|
${src_dir}/threading/thread.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/mvcc/id.cpp
|
2016-09-10 01:48:15 +08:00
|
|
|
${src_dir}/snapshot/snapshot_engine.cpp
|
2016-09-08 20:25:52 +08:00
|
|
|
${src_dir}/snapshot/snapshoter.cpp
|
|
|
|
${src_dir}/snapshot/snapshot_encoder.cpp
|
2016-09-09 23:14:20 +08:00
|
|
|
${src_dir}/snapshot/snapshot_decoder.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/vertices.cpp
|
2016-08-10 16:39:02 +08:00
|
|
|
${src_dir}/storage/edges.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/label/label.cpp
|
|
|
|
${src_dir}/storage/label/label_collection.cpp
|
|
|
|
${src_dir}/storage/label/label_store.cpp
|
2016-11-29 11:08:08 +08:00
|
|
|
${src_dir}/storage/label/labels_writer.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/edge_type/edge_type.cpp
|
|
|
|
${src_dir}/storage/edge_type/edge_type_store.cpp
|
|
|
|
${src_dir}/storage/model/properties/null.cpp
|
|
|
|
${src_dir}/storage/model/properties/bool.cpp
|
2016-09-05 17:02:48 +08:00
|
|
|
${src_dir}/storage/model/properties/int32.cpp
|
|
|
|
${src_dir}/storage/model/properties/int64.cpp
|
|
|
|
${src_dir}/storage/model/properties/float.cpp
|
|
|
|
${src_dir}/storage/model/properties/double.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/model/properties/string.cpp
|
2016-08-23 02:03:45 +08:00
|
|
|
${src_dir}/storage/model/properties/array.cpp
|
2016-09-09 23:14:20 +08:00
|
|
|
${src_dir}/storage/model/properties/property.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/model/properties/properties.cpp
|
2016-09-05 17:02:48 +08:00
|
|
|
${src_dir}/storage/model/properties/stored_property.cpp
|
2016-08-18 22:34:36 +08:00
|
|
|
${src_dir}/storage/model/properties/property_family.cpp
|
2016-09-13 03:13:04 +08:00
|
|
|
${src_dir}/storage/indexes/indexes.cpp
|
2016-08-25 22:29:45 +08:00
|
|
|
${src_dir}/storage/indexes/index_base.cpp
|
|
|
|
${src_dir}/storage/indexes/index_record.cpp
|
|
|
|
${src_dir}/storage/indexes/index_update.cpp
|
|
|
|
${src_dir}/storage/indexes/index_holder.cpp
|
|
|
|
${src_dir}/storage/indexes/impl/unique_ordered_index.cpp
|
2016-08-18 22:34:36 +08:00
|
|
|
${src_dir}/storage/indexes/impl/nonunique_unordered_index.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/locking/record_lock.cpp
|
2016-08-25 22:29:45 +08:00
|
|
|
${src_dir}/storage/garbage/garbage.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/vertex_accessor.cpp
|
2016-09-13 03:13:04 +08:00
|
|
|
${src_dir}/transactions/snapshot.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/transactions/transaction.cpp
|
2016-09-10 03:56:53 +08:00
|
|
|
${src_dir}/transactions/transaction_read.cpp
|
2016-07-11 09:39:33 +08:00
|
|
|
${src_dir}/template_engine/engine.cpp
|
2016-08-10 16:39:02 +08:00
|
|
|
${src_dir}/logging/streams/stdout.cpp
|
|
|
|
${src_dir}/logging/levels.cpp
|
|
|
|
${src_dir}/logging/logs/sync_log.cpp
|
|
|
|
${src_dir}/logging/logs/async_log.cpp
|
|
|
|
${src_dir}/logging/default.cpp
|
|
|
|
${src_dir}/logging/log.cpp
|
|
|
|
${src_dir}/io/network/tls.cpp
|
2016-08-13 06:01:39 +08:00
|
|
|
${src_dir}/database/db.cpp
|
2016-08-25 22:29:45 +08:00
|
|
|
${src_dir}/database/db_transaction.cpp
|
2016-08-13 06:01:39 +08:00
|
|
|
${src_dir}/database/db_accessor.cpp
|
|
|
|
${src_dir}/storage/edge_accessor.cpp
|
2016-08-18 22:34:36 +08:00
|
|
|
${src_dir}/storage/record_accessor.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
)
|
2016-08-08 16:32:34 +08:00
|
|
|
|
|
|
|
# STATIC library used by memgraph executables
|
|
|
|
add_library(memgraph STATIC ${memgraph_src_files})
|
|
|
|
|
|
|
|
# STATIC PIC library used by query engine
|
|
|
|
add_library(memgraph_pic STATIC ${memgraph_src_files})
|
|
|
|
set_property(TARGET memgraph_pic PROPERTY POSITION_INDEPENDENT_CODE TRUE)
|
2016-07-02 05:05:03 +08:00
|
|
|
|
2016-12-16 21:05:04 +08:00
|
|
|
# TODO: test build & run logic T190
|
|
|
|
|
|
|
|
include_directories(${catch_source_dir}/include)
|
|
|
|
|
2016-07-02 05:05:03 +08:00
|
|
|
# tests
|
2016-08-10 16:39:02 +08:00
|
|
|
if (TESTS)
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|
2016-08-01 01:58:12 +08:00
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
# proof of concepts
|
|
|
|
if (POC)
|
|
|
|
add_subdirectory(poc)
|
|
|
|
endif()
|
2016-08-08 16:32:34 +08:00
|
|
|
|
2016-12-16 21:05:04 +08:00
|
|
|
# benchmark test binaries
|
2016-10-04 21:09:21 +08:00
|
|
|
if (BENCHMARK)
|
2016-11-19 00:35:29 +08:00
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/benchmark)
|
2016-10-04 21:09:21 +08:00
|
|
|
endif()
|
2016-08-23 02:03:45 +08:00
|
|
|
|
2016-12-16 21:05:04 +08:00
|
|
|
# concurrent test binaries
|
|
|
|
if (CONCURRENT)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/concurrent)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# integration test binaries
|
|
|
|
if (INTEGRATION)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/integration)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# integration test binaries
|
|
|
|
if (MANUAL)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/manual)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# integration test binaries
|
|
|
|
if (UNIT)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests/unit)
|
|
|
|
endif()
|
|
|
|
|
2016-08-01 01:58:12 +08:00
|
|
|
# memgraph build name
|
|
|
|
execute_process(
|
2016-08-15 01:49:56 +08:00
|
|
|
OUTPUT_VARIABLE COMMIT_BRANCH
|
|
|
|
COMMAND git rev-parse --abbrev-ref HEAD
|
2016-08-01 01:58:12 +08:00
|
|
|
)
|
|
|
|
execute_process(
|
|
|
|
OUTPUT_VARIABLE COMMIT_HASH
|
|
|
|
COMMAND git rev-parse --short HEAD
|
|
|
|
)
|
2016-08-15 01:49:56 +08:00
|
|
|
execute_process(
|
2016-08-20 01:40:04 +08:00
|
|
|
OUTPUT_VARIABLE COMMIT_NO
|
2016-08-15 01:49:56 +08:00
|
|
|
COMMAND git rev-list --count HEAD
|
|
|
|
)
|
|
|
|
string(STRIP ${COMMIT_BRANCH} COMMIT_BRANCH)
|
2016-08-01 01:58:12 +08:00
|
|
|
string(STRIP ${COMMIT_NO} COMMIT_NO)
|
2016-08-15 01:49:56 +08:00
|
|
|
string(STRIP ${COMMIT_HASH} COMMIT_HASH)
|
2016-08-10 16:39:02 +08:00
|
|
|
set(MEMGRAPH_BUILD_NAME
|
2016-09-05 08:35:52 +08:00
|
|
|
"memgraph_${COMMIT_NO}_${COMMIT_HASH}_${COMMIT_BRANCH}_${CMAKE_BUILD_TYPE}")
|
2016-08-01 01:58:12 +08:00
|
|
|
|
2016-10-13 21:42:19 +08:00
|
|
|
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
|
|
|
|
message(STATUS "Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
message(STATUS "Release flags: ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
|
2016-08-08 16:32:34 +08:00
|
|
|
# memgraph main executable
|
2016-08-10 16:39:02 +08:00
|
|
|
if (MEMGRAPH)
|
|
|
|
add_executable(${MEMGRAPH_BUILD_NAME} ${src_dir}/memgraph_bolt.cpp)
|
2016-08-30 12:34:08 +08:00
|
|
|
|
2016-11-29 11:08:08 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} memgraph)
|
2016-11-17 22:46:36 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} stdc++fs)
|
2016-08-10 16:39:02 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} Threads::Threads)
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} cypher_lib)
|
|
|
|
if (UNIX)
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} crypto)
|
|
|
|
# target_link_libraries(${MEMGRAPH_BUILD_NAME} ssl)
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} ${fmt_static_lib})
|
2016-09-05 08:35:52 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} ${yaml_static_lib})
|
2016-08-10 16:39:02 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} dl)
|
|
|
|
endif (UNIX)
|
|
|
|
endif()
|