gazetk / Protocol / CMakeLists.txt @ 5d65b84e
History | View | Annotate | Download (1003 Bytes)
1 |
cmake_minimum_required (VERSION 3.0) |
---|---|
2 |
|
3 |
project (GazeTkProtocol) |
4 |
|
5 |
# Versioning |
6 |
set (GazeTkProtocol_VERSION_MAJOR 0) |
7 |
set (GazeTkProtocol_VERSION_MINOR 1) |
8 |
|
9 |
# configure the header of the library |
10 |
configure_file ( |
11 |
"${PROJECT_SOURCE_DIR}/src_cpp/Protocol.h.in" |
12 |
"${PROJECT_BINARY_DIR}/Protocol.h" |
13 |
) |
14 |
|
15 |
# add the binary tree to the search path for include files |
16 |
# so that the generated files are found |
17 |
include_directories("${PROJECT_BINARY_DIR}") |
18 |
|
19 |
# add the Google protobuf parts |
20 |
find_package(Protobuf REQUIRED) |
21 |
include_directories(${PROTOBUF_INCLUDE_DIRS}) |
22 |
include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
23 |
set (PROTOBUF_IMPORT_DIRS specification) |
24 |
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS specification/basic_types.proto specification/eye_data.proto specification/gaze2d_data.proto specification/gaze3d_data.proto specification/messages.proto) |
25 |
|
26 |
# add the library |
27 |
add_library(GazeTkProtocol STATIC src_cpp/protocol.cc ${PROTO_SRCS} ${PROTO_HDRS}) |
28 |
target_link_libraries(GazeTkProtocol ${PROTOBUF_LIBRARIES}) |