2019-06-25 15:33:55 -04:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
|
|
|
set(PROTO_COMPILER "protoc")
|
|
|
|
set(PROTO_C_COMPILER "protoc-c")
|
|
|
|
set(C_OUT_PATH "${CMAKE_CURRENT_LIST_DIR}/../proto-c")
|
|
|
|
set(PY_OUT_PATH "${CMAKE_CURRENT_LIST_DIR}/../python")
|
|
|
|
set(PROTOCOMM_INCL_PATH "${CMAKE_CURRENT_LIST_DIR}/../../protocomm/proto")
|
|
|
|
|
2019-07-04 02:36:30 -04:00
|
|
|
set(PROTO_SRCS "esp_local_ctrl.proto")
|
2019-06-25 15:33:55 -04:00
|
|
|
|
|
|
|
add_custom_target(c_proto
|
2019-07-04 02:36:30 -04:00
|
|
|
COMMAND ${PROTO_C_COMPILER} --c_out=${C_OUT_PATH} -I . -I ${PROTOCOMM_INCL_PATH} ${PROTO_SRCS}
|
2019-06-25 15:33:55 -04:00
|
|
|
VERBATIM
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(python_proto
|
2019-07-04 02:36:30 -04:00
|
|
|
COMMAND ${PROTO_COMPILER} --python_out=${PY_OUT_PATH} -I . -I ${PROTOCOMM_INCL_PATH} ${PROTO_SRCS}
|
2019-06-25 15:33:55 -04:00
|
|
|
VERBATIM
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(proto ALL
|
|
|
|
DEPENDS c_proto python_proto
|
|
|
|
VERBATIM
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
)
|