-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
40 lines (32 loc) · 1.51 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
cmake_minimum_required(VERSION 3.5)
message(STATUS "Using CMake version ${CMAKE_VERSION}")
project(dbos-scheduler)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Additional CMake files path
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(gRPC_SSL_PROVIDER "package" CACHE STRING "")
# NOTE: change this path or comment it out if openssl is installed at a different path.
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/openssl/install" CACHE STRING "")
set(OPENSSL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/openssl/install/include" CACHE STRING "")
find_package(OpenSSL REQUIRED)
# Find gRPC installation
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/grpc ${CMAKE_CURRENT_BINARY_DIR}/grpc EXCLUDE_FROM_ALL)
message(STATUS "Using gRPC via add_subdirectory.")
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_REFLECTION grpc++_reflection)
set(_GRPC_GRPCPP grpc++)
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:grpc_cpp_plugin>)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/grpc/include)
# Find protobuf installation
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/protobuf/cmake/install/)
INCLUDE(FindProtobuf)
find_package(Protobuf CONFIG REQUIRED)
find_program(Protobuf_PROTOC_EXECUTABLE protoc)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Targets
add_subdirectory(protos)
add_subdirectory(src)