-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
56 lines (42 loc) · 1.84 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
cmake_minimum_required(VERSION 3.15)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(
agrpc
LANGUAGES C CXX
VERSION 0.1)
set(CMAKE_CXX_STANDARD 20)
#-------------------------------------------------------------------------------
# AGRPC common settings
#-------------------------------------------------------------------------------
set(AGRPC_IDE_FOLDER AGRPC)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(DEFAULT_CMAKE_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to ${DEFAULT_CMAKE_BUILD_TYPE}")
set(CMAKE_BUILD_TYPE "${DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Build type (default ${DEFAULT_CMAKE_BUILD_TYPE})" FORCE)
endif()
#-------------------------------------------------------------------------------
# Project component configuration
#-------------------------------------------------------------------------------
option(AGRPC_BUILD_EXAMPLES "Compile agrpc examples" ON)
option(AGRPC_BUILD_TESTS "Compile agrpc with unit testing" ON)
option(AGRPC_ENABLE_THREADING "Builds AGRPC with thread library support." ON)
#-------------------------------------------------------------------------------
# AGRPC utility definitions
#-------------------------------------------------------------------------------
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_BINARY_DIR})
include(agrpc_macros)
include(agrpc_copts)
include(agrpc_cc_binary)
include(agrpc_cc_library)
include(agrpc_cc_test)
include(agrpc_cc_proto_library)
include(agrpc_add_all_subdirs)
include(third_party)
# Third-party directories that we include using the simpler add_subdirectory
# method
add_subdirectory(third_party/libunifex)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR})
add_subdirectory(agrpc)