1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-23 21:43:14 +01:00

Another attempt to address path issues for capnp. Related #978

This commit is contained in:
Pavel Odintsov 2023-04-03 20:06:58 +01:00
parent 888c66a771
commit 727d793b71

@ -250,12 +250,19 @@ else()
message(FATAL_ERROR "Can't find capnp compiler") message(FATAL_ERROR "Can't find capnp compiler")
endif() endif()
# We need these flags on Linux but Windows does not accept such arguments as part of command call
SET(CAPNP_ENVORONMENT_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} PATH=$ENV{PATH}:${CAPNP_CUSTOM_INSTALL_PATH}/bin")
# Remove them for Windows
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
SET(CAPNP_ENVORONMENT_VARIABLES "")
endif()
# Generate capnp bindings # Generate capnp bindings
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp.c++ OUTPUT ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp.c++
DEPENDS ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp DEPENDS ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp
COMMAND "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}" "PATH=$ENV{PATH}:${CAPNP_CUSTOM_INSTALL_PATH}/bin" ${CAPNP_BINARY} compile --output c++:${PROJECT_SOURCE_DIR}/simple_packet_capnp --src-prefix=${PROJECT_SOURCE_DIR}/simple_packet_capnp ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp COMMAND ${CAPNP_ENVORONMENT_VARIABLES}${CAPNP_BINARY} compile --output c++:${PROJECT_SOURCE_DIR}/simple_packet_capnp --src-prefix=${PROJECT_SOURCE_DIR}/simple_packet_capnp ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp
COMMENT "Build Cap'n'Proto binding for C++" COMMENT "Build Cap'n'Proto binding for C++"
) )