cmake_minimum_required (VERSION 3.0) project (GazeTkProtocol) # Versioning set (GazeTkProtocol_VERSION_MAJOR 0) set (GazeTkProtocol_VERSION_MINOR 1) # configure the header of the library configure_file ( "${PROJECT_SOURCE_DIR}/src_cpp/Protocol.h.in" "${PROJECT_BINARY_DIR}/Protocol.h" ) # add the binary tree to the search path for include files # so that the generated files are found include_directories("${PROJECT_BINARY_DIR}") # add the Google protobuf parts find_package(Protobuf REQUIRED) include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) set (PROTOBUF_IMPORT_DIRS specification) 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) # add the library add_library(GazeTkProtocol STATIC src_cpp/protocol.cc ${PROTO_SRCS} ${PROTO_HDRS}) target_link_libraries(GazeTkProtocol ${PROTOBUF_LIBRARIES})