|
| 1 | +# Copyright(c) 2023 ZettaScale Technology and others |
| 2 | +# |
| 3 | +# This program and the accompanying materials are made available under the |
| 4 | +# terms of the Eclipse Public License v. 2.0 which is available at |
| 5 | +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License |
| 6 | +# v. 1.0 which is available at |
| 7 | +# http://www.eclipse.org/org/documents/edl-v10.php. |
| 8 | +# |
| 9 | +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause |
| 10 | + |
| 11 | +cmake_minimum_required(VERSION 3.16) |
| 12 | +project(recorder_replayer LANGUAGES C CXX) |
| 13 | + |
| 14 | +include(FetchContent) |
| 15 | + |
| 16 | +# Prevent subprojects (like mcap_builder) from attempting to find lz4/zstd |
| 17 | +set(CMAKE_DISABLE_FIND_PACKAGE_lz4 TRUE) |
| 18 | +set(CMAKE_DISABLE_FIND_PACKAGE_zstd TRUE) |
| 19 | +set(CMAKE_DISABLE_FIND_PACKAGE_LZ4 TRUE) |
| 20 | +set(CMAKE_DISABLE_FIND_PACKAGE_ZSTD TRUE) |
| 21 | + |
| 22 | +FetchContent_Declare( |
| 23 | + mcap_builder |
| 24 | + GIT_REPOSITORY https://github.com/olympus-robotics/mcap_builder.git |
| 25 | + GIT_TAG main |
| 26 | +) |
| 27 | +FetchContent_MakeAvailable(mcap_builder) |
| 28 | + |
| 29 | +if(NOT TARGET CycloneDDS::ddsc) |
| 30 | + find_package(CycloneDDS REQUIRED) |
| 31 | +endif() |
| 32 | + |
| 33 | +add_library(dds_topic_descriptor_serde STATIC dds_topic_descriptor_serde.c) |
| 34 | +if(TARGET CycloneDDS::ddsc) |
| 35 | + # we need dds_stream_countops() |
| 36 | + target_include_directories(dds_topic_descriptor_serde |
| 37 | + PRIVATE |
| 38 | + "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/cdr/include") |
| 39 | +endif() |
| 40 | +target_include_directories(dds_topic_descriptor_serde PUBLIC .) |
| 41 | + |
| 42 | +target_link_libraries(dds_topic_descriptor_serde PRIVATE CycloneDDS::ddsc) |
| 43 | + |
| 44 | +add_executable(recorder dds_recorder.cpp) |
| 45 | + |
| 46 | +# add_executable(replayer dds_replayer.cpp) |
| 47 | + |
| 48 | +if(TARGET CycloneDDS::ddsc) |
| 49 | + target_include_directories(recorder |
| 50 | + PRIVATE |
| 51 | + "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/cdr/include" |
| 52 | + "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/ddsi/include") |
| 53 | +endif() |
| 54 | +target_link_libraries(recorder CycloneDDS::ddsc dds_topic_descriptor_serde mcap) |
| 55 | +target_compile_definitions(recorder PUBLIC "MCAP_COMPRESSION_NO_ZSTD") |
| 56 | +target_compile_definitions(recorder PUBLIC "MCAP_COMPRESSION_NO_LZ4") |
0 commit comments