2016-12-18 04:00:32 +08:00
|
|
|
# MemGraph CMake configuration
|
|
|
|
|
2016-06-05 20:30:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# !! IMPORTANT !! run ./project_root/init.sh before cmake command
|
|
|
|
# to download dependencies
|
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
if(NOT UNIX)
|
|
|
|
message(FATAL "Unsupported operating system.")
|
|
|
|
endif()
|
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# choose a compiler
|
2017-02-17 23:11:57 +08:00
|
|
|
# NOTE: must be choosen before use of project() or enable_language() ----------
|
2016-12-18 04:00:32 +08:00
|
|
|
set(CMAKE_C_COMPILER "clang")
|
|
|
|
set(CMAKE_CXX_COMPILER "clang++")
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# set project name
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-11-19 00:35:29 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# custom function definitions
|
|
|
|
include(functions)
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-06-26 00:26:26 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# threading
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
# -----------------------------------------------------------------------------
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-06-27 06:43:28 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# dir variables
|
2016-05-29 03:18:26 +08:00
|
|
|
set(src_dir ${CMAKE_SOURCE_DIR}/src)
|
|
|
|
set(libs_dir ${CMAKE_SOURCE_DIR}/libs)
|
2017-02-14 16:37:32 +08:00
|
|
|
set(tests_dir ${CMAKE_SOURCE_DIR}/tests)
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
# build flags -----------------------------------------------------------------
|
|
|
|
# release flags
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
|
|
|
#debug flags
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
|
|
|
|
|
|
|
# compiler specific 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()
|
|
|
|
|
|
|
|
# default build type is debug
|
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
|
|
|
set(CMAKE_BUILD_TYPE "debug")
|
|
|
|
endif()
|
|
|
|
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# setup external dependencies -------------------------------------------------
|
|
|
|
add_subdirectory(libs)
|
2016-06-26 00:26:26 +08:00
|
|
|
# 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)
|
2017-02-17 23:11:57 +08:00
|
|
|
# antlr
|
|
|
|
set(antlr_static_lib ${CMAKE_SOURCE_DIR}/dist/libantlr4-runtime.a)
|
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
|
2017-02-19 01:03:48 +08:00
|
|
|
# copy query_engine template file
|
|
|
|
set(query_engine_template_file ${src_dir}/query/plan_template_cpp)
|
|
|
|
FILE(COPY ${query_engine_template_file}
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests/template)
|
|
|
|
FILE(COPY ${query_engine_template_file}
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests/integration/template)
|
|
|
|
FILE(COPY ${query_engine_template_file}
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests/manual/template)
|
|
|
|
FILE(COPY ${query_engine_template_file}
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/template)
|
2016-06-27 06:43:28 +08:00
|
|
|
# create destination folder for compiled queries
|
2017-02-14 16:37:32 +08:00
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/integration/compiled)
|
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/manual/compiled)
|
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/compiled)
|
|
|
|
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/compiled)
|
|
|
|
# copy hardcoded queries
|
|
|
|
FILE(COPY ${tests_dir}/integration/hardcoded_query
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests/integration)
|
|
|
|
FILE(COPY ${tests_dir}/integration/stream
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests/integration)
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-06-27 06:43:28 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# copy files needed for query engine (headers)
|
2017-02-17 23:11:57 +08:00
|
|
|
# TODO: copy includes for runtime compilation
|
|
|
|
# include(copy_includes)
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
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()
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
# logging levels --------------------------------------------------------------
|
2016-08-11 11:47:30 +08:00
|
|
|
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()
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# logger type
|
|
|
|
# the default logger is sync logger
|
|
|
|
# on: cmake ... -DSYNC_LOGGER=OFF ... async logger is going to be used
|
|
|
|
option(SYNC_LOGGER "Sync logger" ON)
|
|
|
|
message(STATUS "SYNC_LOGGER: ${SYNC_LOGGER}")
|
2016-08-19 08:28:22 +08:00
|
|
|
if (SYNC_LOGGER)
|
|
|
|
add_definitions(-DSYNC_LOGGER)
|
|
|
|
endif()
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
2017-01-08 08:03:12 +08:00
|
|
|
# custom assert control parameters
|
|
|
|
|
|
|
|
# Runtime assert, if value is OFF runtime asserts will be inactive during
|
|
|
|
# runtime. Default value is ON.
|
2016-08-11 11:47:30 +08:00
|
|
|
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()
|
|
|
|
|
2017-01-08 08:03:12 +08:00
|
|
|
# by default on custom assert only the message, filename and line number will be
|
|
|
|
# printed on stderr, if STACKTRACE_ASSERT is ON the whole stacktrace is going to
|
|
|
|
# be printed on stderr
|
|
|
|
option(STACKTRACE_ASSERT "Dump stacktrace on custom assert" OFF)
|
|
|
|
message(STATUS "STACKTRACE_ASSERT: ${STACKTRACE_ASSERT}")
|
|
|
|
if(STACKTRACE_ASSERT)
|
|
|
|
add_definitions(-DSTACKTRACE_ASSERT_ON)
|
2016-06-15 06:06:21 +08:00
|
|
|
endif()
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# ndebug
|
2016-06-15 06:06:21 +08:00
|
|
|
option(NDEBUG "No debug" OFF)
|
2016-12-18 04:00:32 +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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
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
|
2016-12-18 04:00:32 +08:00
|
|
|
# this flag is present (TODO: figure out why)
|
2016-10-13 21:42:19 +08:00
|
|
|
option(GLIBCXX_DEBUG "glibc debug" OFF)
|
2016-12-18 04:00:32 +08:00
|
|
|
message(STATUS "GLIBCXX_DEBUG: ${GLIBCXX_DEBUG} (solves problem with \
|
|
|
|
_M_dataplus member during a debugging process)")
|
2016-10-13 21:42:19 +08:00
|
|
|
if(GLIBCXX_DEBUG)
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-D_GLIBCXX_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
|
|
|
|
endif()
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-12-18 04:00:32 +08:00
|
|
|
|
|
|
|
# option binaries
|
|
|
|
# memgraph
|
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-12-18 04:00:32 +08:00
|
|
|
# proof of concept
|
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-12-18 04:00:32 +08:00
|
|
|
# tests
|
|
|
|
option(ALL_TESTS "Add all test binaries" ON)
|
|
|
|
message(STATUS "Add all test binaries: ${ALL_TESTS}")
|
|
|
|
option(BENCHMARK_TESTS "Add benchmark test binaries" OFF)
|
|
|
|
message(STATUS "Add benchmark test binaries: ${BENCHMARK_TESTS}")
|
|
|
|
option(CONCURRENT_TESTS "Add concurrent test binaries" OFF)
|
|
|
|
message(STATUS "Add concurrent test binaries: ${CONCURRENT_TESTS}")
|
|
|
|
option(INTEGRATION_TESTS "Add integration test binaries" OFF)
|
|
|
|
message(STATUS "Add integration test binaries: ${INTEGRATION_TESTS}")
|
|
|
|
option(MANUAL_TESTS "Add manual test binaries" OFF)
|
|
|
|
message(STATUS "Add manual test binaries: ${MANUAL_TESTS}")
|
|
|
|
option(UNIT_TESTS "Add unit test binaries" OFF)
|
|
|
|
message(STATUS "Add unit test binaries: ${UNIT_TESTS}")
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# 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-08-10 16:39:02 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-05-25 06:37:14 +08:00
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
# openCypher parser -----------------------------------------------------------
|
|
|
|
set(antlr_src ${CMAKE_SOURCE_DIR}/libs/antlr4/runtime/Cpp/runtime/src)
|
|
|
|
set(opencypher_frontend ${CMAKE_SOURCE_DIR}/src/query/frontend/opencypher)
|
|
|
|
set(opencypher_generated ${opencypher_frontend}/generated)
|
|
|
|
set(opencypher_grammar ${opencypher_frontend}/grammar/Cypher.g4)
|
|
|
|
|
|
|
|
# enumerate all files that are generated from antlr
|
|
|
|
set(antlr_opencypher_generated_src
|
|
|
|
${opencypher_frontend}/generated/CypherLexer.cpp
|
|
|
|
${opencypher_frontend}/generated/CypherParser.cpp
|
|
|
|
${opencypher_frontend}/generated/CypherBaseVisitor.cpp
|
|
|
|
${opencypher_frontend}/generated/CypherVisitor.cpp
|
|
|
|
)
|
2016-05-25 06:37:14 +08:00
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
# set generated flag to true
|
|
|
|
# foreach(src_file ${antlr_opencypher_generated_src})
|
|
|
|
# set_source_files_properties(
|
|
|
|
# ${src_file}
|
|
|
|
# PROPERTIES
|
|
|
|
# GENERATED TRUE
|
|
|
|
# )
|
|
|
|
# endforeach(src_file ${antlr_opencypher_generated_src})
|
|
|
|
|
|
|
|
# add custom target for generation
|
|
|
|
add_custom_target(generate_opencypher_parser
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E make_directory ${opencypher_generated}
|
|
|
|
COMMAND
|
|
|
|
java -jar ${CMAKE_BINARY_DIR}/antlr-4.6-complete.jar -Dlanguage=Cpp -visitor -o ${opencypher_generated} -package antlrcpptest ${opencypher_grammar}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
|
|
DEPENDS ${opencypher_grammar}
|
|
|
|
)
|
|
|
|
|
|
|
|
# include antlr header files
|
|
|
|
include_directories(
|
|
|
|
${antlr_src}
|
|
|
|
${antlr_src}/misc
|
|
|
|
${antlr_src}/atn
|
|
|
|
${antlr_src}/dfa
|
|
|
|
${antlr_src}/tree
|
|
|
|
${antlr_src}/support
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(antlr_opencypher_parser_lib STATIC ${antlr_opencypher_generated_src})
|
|
|
|
target_link_libraries(antlr_opencypher_parser_lib ${antlr_static_lib})
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-06-26 00:26:26 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# all memgraph src files
|
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
|
2017-02-06 19:40:55 +08:00
|
|
|
# ${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
|
2017-02-06 19:40:55 +08:00
|
|
|
# ${src_dir}/snapshot/snapshot_engine.cpp
|
|
|
|
# ${src_dir}/snapshot/snapshoter.cpp
|
|
|
|
# ${src_dir}/snapshot/snapshot_encoder.cpp
|
|
|
|
# ${src_dir}/snapshot/snapshot_decoder.cpp
|
2017-02-04 16:01:15 +08:00
|
|
|
${src_dir}/storage/typed_value.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/locking/record_lock.cpp
|
2017-02-06 19:40:55 +08:00
|
|
|
# ${src_dir}/storage/garbage/garbage.cpp
|
2017-02-17 23:11:57 +08:00
|
|
|
${src_dir}/storage/record_accessor.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
${src_dir}/storage/vertex_accessor.cpp
|
2017-02-17 23:11:57 +08:00
|
|
|
${src_dir}/storage/edge_accessor.cpp
|
|
|
|
# ${src_dir}/storage/record_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
|
2017-02-06 19:40:55 +08:00
|
|
|
${src_dir}/database/graph_db.cpp
|
|
|
|
${src_dir}/database/graph_db_accessor.cpp
|
2016-07-07 08:58:26 +08:00
|
|
|
)
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-08-08 16:32:34 +08:00
|
|
|
|
|
|
|
# STATIC library used by memgraph executables
|
2016-12-18 04:00:32 +08:00
|
|
|
add_library(memgraph_lib STATIC ${memgraph_src_files})
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-08-08 16:32:34 +08:00
|
|
|
|
|
|
|
# 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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-08-08 16:32:34 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# tests
|
|
|
|
if (ALL_TESTS OR BENCHMARK_TESTS OR CONCURRENT_TEST OR INTEGRATION_TEST
|
|
|
|
OR MANUAL_TESTS OR UNIT_TESTS)
|
|
|
|
add_subdirectory(tests)
|
2016-12-16 21:05:04 +08:00
|
|
|
endif()
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-12-16 21:05:04 +08:00
|
|
|
|
2017-02-17 23:11:57 +08:00
|
|
|
execute_process(
|
|
|
|
COMMAND python recursive_include.py --root ${src_dir} --start ${src_dir}/query/plan_interface.hpp --copy ${CMAKE_BINARY_DIR}/include
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake
|
|
|
|
)
|
|
|
|
|
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-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2016-10-13 21:42:19 +08:00
|
|
|
|
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-12-18 04:00:32 +08:00
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} memgraph_lib)
|
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)
|
2017-02-17 23:11:57 +08:00
|
|
|
# target_link_libraries(${MEMGRAPH_BUILD_NAME} crypto)
|
|
|
|
# target_link_libraries(${MEMGRAPH_BUILD_NAME} ssl)
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} ${fmt_static_lib})
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} ${yaml_static_lib})
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} ${antlr_static_lib})
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} antlr_opencypher_parser_lib)
|
|
|
|
target_link_libraries(${MEMGRAPH_BUILD_NAME} dl)
|
2016-08-10 16:39:02 +08:00
|
|
|
endif()
|
2017-02-17 23:11:57 +08:00
|
|
|
# add_dependencies(${MEMGRAPH_BUILD_NAME} generate_opencypher_parser)
|
2016-12-18 04:00:32 +08:00
|
|
|
# -----------------------------------------------------------------------------
|
2017-02-17 23:11:57 +08:00
|
|
|
|
|
|
|
# make CLion aware of all source files so we get refactoring etc
|
|
|
|
# TODO: fix snapshots and everything from src and then add custom target
|
|
|
|
#file(GLOB_RECURSE __SOURCES ${CMAKE_SOURCE_DIR}/src/*.hpp ${CMAKE_SOURCE_DIR}/src/*.cpp)
|
|
|
|
#add_executable(__refactor_target ${__SOURCES})
|
|
|
|
#target_link_libraries(__refactor_target memgraph_lib stdc++fs Threads::Threads ${fmt_static_lib} ${yaml_static_lib} ${antlr_static_lib} antlr_opencypher_parser_lib dl)
|
|
|
|
#add_dependencies(__refactor_target generate_opencypher_parser)
|