-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
45 lines (34 loc) · 1.37 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
# Minimum CMake required
cmake_minimum_required(VERSION 3.0)
# Project
project(grpc_gateway_demo C CXX)
include(CMakeDependentOption)
option(BUILD_TEST "Build C++ test binaries (need googletest and benchmark)" ON)
option(USE_SYSTEM_EIGEN_INSTALL
"Use system Eigen instead of the one under third_party" OFF)
CMAKE_DEPENDENT_OPTION(
grpc_gateway_demo_USE_MSVC_STATIC_RUNTIME "Using MSVC static runtime libraries" ON
"NOT BUILD_SHARED_LIBS" OFF)
# CMake scripts + modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
# CMake build directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Include utils
include(cmake/utils.cmake)
# Set default build type
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type not set - defaulting to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build from: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
# Dependencies
include(cmake/dependencies.cmake)
# Build flags
set(CMAKE_CXX_STANDARD 11)
# Prefix path to grpc_gateway_demo headers.
include_directories(BEFORE ${grpc_gateway_demo_SOURCE_DIR})
# Prefix path to generated grpc_gateway_demo headers.
include_directories(BEFORE ${PROJECT_BINARY_DIR})
# Main build
add_subdirectory(grpc_gateway_demo)