forked from FISCO-BCOS/FISCO-BCOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
131 lines (110 loc) · 3.45 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required(VERSION 3.14)
if(NOT DEFINED URL_BASE)
set(URL_BASE "github.com")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(VERSION "3.5.0")
set(VERSION_SUFFIX "")
include(Options)
configure_project()
# vcpkg init
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- vcpkg WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "Vcpkg toolchain file")
endif()
project(FISCO-BCOS VERSION ${VERSION})
include(CompilerSettings)
include(BuildInfoGenerator)
include(IncludeDirectories)
include(TargetSettings)
include(PrecompiledHeaders)
add_subdirectory(bcos-boostssl)
add_subdirectory(bcos-framework)
add_subdirectory(bcos-crypto)
add_subdirectory(bcos-utilities)
add_subdirectory(concepts)
add_subdirectory(libtask)
add_subdirectory(bcos-protocol)
add_subdirectory(bcos-tars-protocol)
add_subdirectory(bcos-codec)
include(ProjectITTAPI)
include(ProjectSDF)
if(WITH_LIGHTNODE)
add_subdirectory(lightnode)
endif()
if(FULLNODE)
if(WITH_WASM)
include(ProjectWABT)
include(ProjectBCOSWASM)
endif()
include(ProjectGroupSig)
include(ProjectPaillier)
add_subdirectory(bcos-sealer)
add_subdirectory(bcos-security)
add_subdirectory(bcos-scheduler)
add_subdirectory(bcos-executor)
add_subdirectory(bcos-storage)
add_subdirectory(bcos-ledger)
add_subdirectory(bcos-rpc)
add_subdirectory(bcos-gateway)
add_subdirectory(bcos-pbft)
add_subdirectory(bcos-rpbft)
add_subdirectory(bcos-tool)
add_subdirectory(bcos-table)
add_subdirectory(bcos-txpool)
add_subdirectory(bcos-sync)
add_subdirectory(bcos-front)
add_subdirectory(bcos-leader-election)
add_subdirectory(libinitializer)
add_subdirectory(fisco-bcos-air)
add_subdirectory(transaction-executor)
add_subdirectory(transaction-scheduler)
if(WITH_TARS_SERVICES)
add_subdirectory(fisco-bcos-tars-service)
endif()
if(TESTS)
enable_testing()
add_subdirectory(tests)
add_subdirectory(benchmark)
endif()
endif()
if(WITH_CPPSDK)
add_subdirectory(bcos-sdk)
endif()
if(TOOLS)
add_subdirectory(tools)
endif()
# for code coverage
if(COVERAGE)
include(Coverage)
set(TESTS ON)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_CXX_FLAGS "-g --coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-g --coverage ${CMAKE_C_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "--coverage ${CMAKE_EXE_LINKER_FLAGS}")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(-Wno-unused-command-line-argument)
set(CMAKE_CXX_FLAGS "-g -fprofile-arcs -ftest-coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-g -fprofile-arcs -ftest-coverage ${CMAKE_C_FLAGS}")
endif()
config_coverage("coverage" "")
endif()
print_config("FISCO BCOS")
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_SOURCE_DIR}/cmake/fiscobcos-config.cmake.in"
"${CMAKE_BINARY_DIR}/fiscobcos-config.cmake"
INSTALL_DESTINATION "share/fiscobcos"
)
install(
FILES "${CMAKE_BINARY_DIR}/fiscobcos-config.cmake"
DESTINATION "share/fiscobcos"
)
install(
EXPORT fiscobcosTargets
DESTINATION share/fiscobcos
NAMESPACE fiscobcos::
)