forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
98 lines (76 loc) · 2.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
cmake_minimum_required(VERSION 3.0.0)
project("vGraph" CXX)
set(CMAKE_SKIP_RPATH TRUE)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
if (!CMAKE_CXX_COMPILER)
message(FATAL_ERROR "No C++ compiler found")
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++")
# Possible values are Debug, Release, RelWithDebInfo, MinSizeRel
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "_build")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "_build")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "_build")
# Set the project home dir
set(VGRAPH_HOME ${CMAKE_CURRENT_SOURCE_DIR})
# To include customized FindXXX.cmake modules
set(CMAKE_MODULE_PATH "${VGRAPH_HOME}/cmake" ${CMAKE_MODULE_PATH})
find_package(Boost)
find_package(OpenSSL)
find_package(Krb5 REQUIRED gssapi)
find_package(PCHSupport)
add_compile_options(-Winvalid-pch)
include_directories(SYSTEM ${VGRAPH_HOME}/third-party/_build/include)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
include_directories(SYSTEM ${KRB5_INCLUDE_DIRS})
include_directories(AFTER common)
include_directories(AFTER interface)
include_directories(AFTER ${VGRAPH_HOME})
link_directories(third-party/_build/lib ${Boost_LIBRARY_DIRS} ${KRB5_LIBRARY_DIRS})
# All thrift libraries
set(THRIFT_LIBRARIES
thriftcpp2
thrift
thriftprotocol
server
async
protocol
transport
concurrency
security
thriftfrozen2
thrift-core
)
# All compression libraries
set(COMPRESSION_LIBRARIES bz2 snappy zstd z)
add_subdirectory(third-party)
add_subdirectory(interface)
add_subdirectory(common)
add_subdirectory(dataman)
add_subdirectory(client)
#add_subdirectory(storage)
add_subdirectory(server)
add_subdirectory(console)
add_subdirectory(consensus)
add_dependencies(common third-party)
#add_dependencies(storage_engines common)
add_custom_target(
clean-build
COMMAND ${CMAKE_MAKE_PROGRAM} clean
DEPENDS clean-interface clean-pch
)
add_custom_target(
clean-all
COMMAND ${CMAKE_MAKE_PROGRAM} clean
DEPENDS clean-interface clean-pch clean-third-party
)
add_custom_target(
distclean
COMMAND "find" "." "-name" "CMakeFiles" "|" "xargs" "rm" "-fr"
COMMAND "find" "." "-name" "CMakeCache.txt" "|" "xargs" "rm" "-f"
COMMAND "find" "." "-name" "cmake_install.cmake" "|" "xargs" "rm" "-f"
COMMAND "find" "." "-name" "Makefile" "|" "xargs" "rm" "-f"
DEPENDS clean-all
)