blob: 99c948233b1652a3d3a060f39abf3a3c38c88144 (
plain)
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
33
34
35
|
find_package(CapnProto REQUIRED)
set(PROTOS LogicalNetlist.capnp PhysicalNetlist.capnp References.capnp)
set(INTERCHANGE_SCHEMA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../interchange)
find_program(WGET wget REQUIRED)
set(JAVA_SCHEMA ${CMAKE_CURRENT_BINARY_DIR}/schema/capnp/java.capnp)
add_custom_command(
OUTPUT ${JAVA_SCHEMA}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/schema/capnp/
COMMAND ${WGET}
https://raw.githubusercontent.com/capnproto/capnproto-java/master/compiler/src/main/schema/capnp/java.capnp
-O ${JAVA_SCHEMA}
)
add_custom_target(
get_java_capnp_schema
DEPENDS ${JAVA_SCHEMA})
set(CAPNPC_IMPORT_DIRS)
list(APPEND CAPNPC_IMPORT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/schema)
set(CAPNPC_SRC_PREFIX ${INTERCHANGE_SCHEMA_DIR})
set(CAPNP_SRCS)
set(CAPNP_HDRS)
foreach (proto ${PROTOS})
capnp_generate_cpp(CAPNP_SRC CAPNP_HDR ${INTERCHANGE_SCHEMA_DIR}/${proto})
list(APPEND CAPNP_HDRS ${CAPNP_HDR})
list(APPEND CAPNP_SRCS ${CAPNP_SRC})
endforeach()
add_library(fpga_interchange_capnp STATIC ${CAPNP_SRCS})
add_dependencies(fpga_interchange_capnp get_java_capnp_schema)
target_link_libraries(fpga_interchange_capnp PRIVATE CapnProto::capnp)
set(FPGA_INTERCHANGE_CAPNP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../interchange)
|