-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
32 lines (25 loc) · 934 Bytes
/
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
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/"
)
find_package(Protobuf REQUIRED)
set(PROTO_DEFS
def/wrapper.proto
def/misc.proto
def/vars.proto
def/funcs.proto
def/classes.proto
def/tmpl.proto
def/base.proto
)
include_directories(${PROTOBUF_INCLUDE_DIRS})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_DEFS})
set(CPPTOOL_PROTO_INCLUDES ${PROTOBUF_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
set(CPPTOOL_PROTO_LIBRARY cppToolProto PARENT_SCOPE)
add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI -D_SCL_SECURE_NO_WARNINGS)
add_library(cppToolProto STATIC ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(cppToolProto ${PROTOBUF_LIBRARIES})
# Custom targets for java and python bindings
include(ProtobufExtend)
generate_extra_protobuf_language(Java --java_out ${PROTO_DEFS})
generate_extra_protobuf_language(Python --python_out ${PROTO_DEFS})