Summary: With this diff, each build of Memgraph has a version that uniquely identifies it. The given version uniquely identifies both official release builds and development builds. Enterprise/community builds are also differentiated in the version. Also, support for custom suffixes is added to support custom builds for customers. Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2662
31 lines
1.1 KiB
CMake
31 lines
1.1 KiB
CMake
# Generate a version.hpp file
|
|
set(VERSION_STRING ${MEMGRAPH_VERSION})
|
|
configure_file(../../src/version.hpp.in version.hpp @ONLY)
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
# Memgraph Client Target
|
|
add_executable(mg_client mg_client/main.cpp)
|
|
set(CLIENT_LIBS mg-communication mg-io mg-utils)
|
|
if (READLINE_FOUND)
|
|
list(APPEND CLIENT_LIBS readline)
|
|
endif()
|
|
target_link_libraries(mg_client ${CLIENT_LIBS})
|
|
|
|
# Memgraph Dump Target
|
|
add_executable(mg_dump mg_dump/main.cpp)
|
|
target_include_directories(mg_dump PRIVATE ${MGCLIENT_INCLUDE_DIR})
|
|
target_link_libraries(mg_dump fmt gflags glog mgclient pthread)
|
|
|
|
# Strip the executable in release build.
|
|
string(TOLOWER ${CMAKE_BUILD_TYPE} lower_build_type)
|
|
if (lower_build_type STREQUAL "release")
|
|
add_custom_command(TARGET mg_client POST_BUILD
|
|
COMMAND strip -s mg_client
|
|
COMMENT "Stripping symbols and sections from mg_client")
|
|
endif()
|
|
|
|
install(TARGETS mg_client RUNTIME DESTINATION bin)
|
|
|
|
# Target for building all the tool executables.
|
|
add_custom_target(tools DEPENDS mg_client mg_dump)
|