Setup building with glog library
Summary: To use the library in code, do the following. * Include glog, `include "glog/logging.h"` * Initialize logging from a main entry point, `google::InitGoogleLogging(argv[0]);` * Log anywhere from your code, `LOG(INFO) << "Hello world from glog";` For advanced use, refer to glog's documentation. Reviewers: mislav.bradac, florijan, dgleich, buda Reviewed By: mislav.bradac, buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D492
This commit is contained in:
parent
492b4919f1
commit
bed62c4f8b
@ -284,6 +284,7 @@ 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)
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# openCypher parser -----------------------------------------------------------
|
||||
@ -373,7 +374,8 @@ set(memgraph_src_files
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# memgraph_lib and memgraph_pic depend on these libraries
|
||||
set(MEMGRAPH_ALL_LIBS gflags stdc++fs Threads::Threads fmt antlr_opencypher_parser_lib dl)
|
||||
set(MEMGRAPH_ALL_LIBS gflags stdc++fs Threads::Threads fmt
|
||||
antlr_opencypher_parser_lib dl ${CMAKE_SOURCE_DIR}/libs/glog/lib/libglog.a)
|
||||
if (READLINE_FOUND)
|
||||
list(APPEND MEMGRAPH_ALL_LIBS ${READLINE_LIBRARY})
|
||||
endif()
|
||||
@ -381,7 +383,8 @@ endif()
|
||||
# STATIC library used by memgraph executables
|
||||
add_library(memgraph_lib STATIC ${memgraph_src_files})
|
||||
target_link_libraries(memgraph_lib ${MEMGRAPH_ALL_LIBS})
|
||||
add_dependencies(memgraph_lib generate_opencypher_parser)
|
||||
add_dependencies(memgraph_lib generate_opencypher_parser
|
||||
glog)
|
||||
|
||||
# STATIC PIC library used by query engine
|
||||
add_library(memgraph_pic STATIC ${memgraph_src_files})
|
||||
|
@ -21,6 +21,17 @@ set(GFLAGS_BUILD_gflags_nothreads_LIB OFF)
|
||||
set(GFLAGS_BUILD_gflags_LIB ON)
|
||||
add_subdirectory(gflags)
|
||||
|
||||
# Setup google logging after gflags (so that glog can use it).
|
||||
# We need to use `ExternalProject`, because currently glog's CMakeLists.txt
|
||||
# doesn't detect gflags if we do `add_subdirectory`.
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(glog DEPENDS gflags
|
||||
PREFIX ${CMAKE_SOURCE_DIR}/libs/glog
|
||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}/libs/glog
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/libs/glog
|
||||
-Dgflags_DIR=${CMAKE_CURRENT_BINARY_DIR}/gflags)
|
||||
|
||||
# setup cppitertools
|
||||
# CLion compatiblity; the target won't be built
|
||||
file(GLOB __CPPITERTOOLS_SOURCES __main.cpp
|
||||
|
@ -47,6 +47,13 @@ cd googletest
|
||||
git checkout ${googletest_tag}
|
||||
cd ..
|
||||
|
||||
# google logging
|
||||
git clone https://github.com/google/glog.git
|
||||
glog_tag="a6a166db069520dbbd653c97c2e5b12e08a8bb26" # v0.3.5
|
||||
cd glog
|
||||
git checkout ${glog_tag}
|
||||
cd ..
|
||||
|
||||
# lcov-to-coberatura-xml
|
||||
git clone https://github.com/eriwen/lcov-to-cobertura-xml.git
|
||||
lcov_to_xml_tag="59584761cb5da4687693faec05bf3e2b74e9dde9" # Dec 6, 2016
|
||||
|
Loading…
Reference in New Issue
Block a user