a6b8d6b4cf
Summary: * main file (copied distributed_test.cpp), start_main.py, config Made a dedicated client and memgraph file (stubs) + code structure changes Reviewers: sasa.stanko Reviewed By: sasa.stanko Subscribers: pullbot, lion, buda Differential Revision: https://phabricator.memgraph.io/D709
61 lines
2.2 KiB
CMake
61 lines
2.2 KiB
CMake
project(distributed)
|
|
|
|
# threading
|
|
find_package(Threads REQUIRED)
|
|
|
|
# set directory variables
|
|
set(src_dir ${PROJECT_SOURCE_DIR}/src)
|
|
set(libs_dir ${PROJECT_SOURCE_DIR}/libs)
|
|
|
|
# includes
|
|
include_directories(${libs_dir}/cereal/include)
|
|
include_directories(${src_dir})
|
|
|
|
# totally hacked, no idea why I need to include these again
|
|
# TODO: ask teon
|
|
include_directories(${CMAKE_SOURCE_DIR}/libs/fmt)
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
|
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS})
|
|
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libs)
|
|
# needed to include configured files (plan_compiler_flags.hpp)
|
|
set(generated_headers_dir ${CMAKE_BINARY_DIR}/generated_headers)
|
|
include_directories(${generated_headers_dir})
|
|
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libs/glog/include)
|
|
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/libs/gflags/include)
|
|
|
|
# library from distributed sources
|
|
file(GLOB_RECURSE src_files ${src_dir}/*.cpp)
|
|
add_library(distributed_lib STATIC ${src_files})
|
|
|
|
## distributed Memgraph executable
|
|
set(executable_name main)
|
|
add_executable(${executable_name} ${PROJECT_SOURCE_DIR}/main.cpp)
|
|
target_link_libraries(${executable_name} distributed_lib)
|
|
target_link_libraries(${executable_name} memgraph_lib)
|
|
target_link_libraries(${executable_name} ${MEMGRAPH_ALL_LIBS})
|
|
|
|
## dummy distributed Memgraph client
|
|
set(executable_name main-client)
|
|
add_executable(${executable_name} ${PROJECT_SOURCE_DIR}/main-client.cpp)
|
|
target_link_libraries(${executable_name} distributed_lib)
|
|
target_link_libraries(${executable_name} memgraph_lib)
|
|
target_link_libraries(${executable_name} ${MEMGRAPH_ALL_LIBS})
|
|
|
|
# tests
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/tests)
|
|
|
|
# copy test scripts into the build/ directory (for distributed tests)
|
|
configure_file(${PROJECT_SOURCE_DIR}/tests/start_distributed.py
|
|
${PROJECT_BINARY_DIR}/tests/start_distributed.py COPYONLY)
|
|
|
|
configure_file(${PROJECT_SOURCE_DIR}/tests/config
|
|
${PROJECT_BINARY_DIR}/tests/config COPYONLY)
|
|
|
|
# copy main scripts into build/ directory (for distributed Memgraph)
|
|
configure_file(${PROJECT_SOURCE_DIR}/start_main.py
|
|
${PROJECT_BINARY_DIR}/start_main.py COPYONLY)
|
|
|
|
configure_file(${PROJECT_SOURCE_DIR}/config
|
|
${PROJECT_BINARY_DIR}/config COPYONLY)
|
|
|