diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-15 09:52:57 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-15 09:52:57 -0800 |
commit | e4931a74f7b84344327e76a052ef97edc93d39fa (patch) | |
tree | 8cd1529e6d1ad7ad7df5980a13c9007cd5edc100 /cmake/cxx_static | |
parent | f2e62c3a0e082111d27e59699ce9caf196aa8be6 (diff) | |
download | fpga-interchange-schema-e4931a74f7b84344327e76a052ef97edc93d39fa.tar.gz fpga-interchange-schema-e4931a74f7b84344327e76a052ef97edc93d39fa.tar.bz2 fpga-interchange-schema-e4931a74f7b84344327e76a052ef97edc93d39fa.zip |
Enable out of source build directory.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'cmake/cxx_static')
-rw-r--r-- | cmake/cxx_static/CMakeLists.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cmake/cxx_static/CMakeLists.txt b/cmake/cxx_static/CMakeLists.txt index e5cfecb..5e7489f 100644 --- a/cmake/cxx_static/CMakeLists.txt +++ b/cmake/cxx_static/CMakeLists.txt @@ -20,6 +20,16 @@ add_custom_target( set(CAPNPC_IMPORT_DIRS) list(APPEND CAPNPC_IMPORT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/schema) +set(CAPNPC_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../interchange") + +add_custom_command( + OUTPUT ${CAPNPC_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${CAPNPC_OUTPUT_DIR} + ) +add_custom_target( + fpga_interchange_capnp_output_directory + DEPENDS ${CAPNPC_OUTPUT_DIR}) + set(CAPNPC_SRC_PREFIX ${INTERCHANGE_SCHEMA_DIR}) set(CAPNP_SRCS) set(CAPNP_HDRS) @@ -29,8 +39,10 @@ foreach (proto ${PROTOS}) list(APPEND CAPNP_SRCS ${CAPNP_SRC}) endforeach() add_library(fpga_interchange_capnp STATIC ${CAPNP_SRCS}) -add_dependencies(fpga_interchange_capnp get_java_capnp_schema) +add_dependencies(fpga_interchange_capnp + get_java_capnp_schema + fpga_interchange_capnp_output_directory) target_link_libraries(fpga_interchange_capnp PRIVATE CapnProto::capnp) -get_filename_component(FPGA_INTERCHANGE_CAPNP_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../interchange" ABSOLUTE) +get_filename_component(FPGA_INTERCHANGE_CAPNP_INCLUDE_DIR "${CAPNPC_OUTPUT_DIR}" ABSOLUTE) target_include_directories(fpga_interchange_capnp INTERFACE ${FPGA_INTERCHANGE_CAPNP_INCLUDE_DIR}) |