diff --git a/mcap_vendor/CMakeLists.txt b/mcap_vendor/CMakeLists.txt index 9902303..b9bc045 100644 --- a/mcap_vendor/CMakeLists.txt +++ b/mcap_vendor/CMakeLists.txt @@ -1,6 +1,11 @@ cmake_minimum_required(VERSION 3.5) project(mcap_vendor LANGUAGES C CXX ASM) +## Dependencies +find_package(ament_cmake REQUIRED) +find_package(zstd_vendor REQUIRED) +find_package(zstd REQUIRED) + ## Compile options if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) @@ -11,12 +16,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic -Werror) endif() -## Dependencies -find_package(ament_cmake REQUIRED) -find_package(zstd_vendor REQUIRED) -find_package(zstd REQUIRED) - - ## Define vendor macro macro(build_mcap_vendor) include(FetchContent) @@ -35,48 +34,42 @@ macro(build_mcap_vendor) file(GLOB _lz4_srcs ${lz4_SOURCE_DIR}/lib/*.c) - add_library( - mcap SHARED + add_library(mcap SHARED src/main.cpp ${_lz4_srcs} ) set(_mcap_include_dir ${mcap_SOURCE_DIR}/cpp/mcap/include) - target_include_directories(mcap SYSTEM PRIVATE + target_include_directories(mcap PRIVATE ${lz4_SOURCE_DIR}/lib ) - target_include_directories(mcap SYSTEM PUBLIC + target_include_directories(mcap PUBLIC "$" - "$" + "$" ) ament_target_dependencies(mcap zstd) install( - DIRECTORY - ${_mcap_include_dir}/mcap - DESTINATION - ${CMAKE_INSTALL_PREFIX}/include + DIRECTORY ${_mcap_include_dir}/mcap + DESTINATION include/${PROJECT_NAME} ) - install(TARGETS mcap EXPORT export_mcap) + install( + TARGETS mcap + EXPORT mcap + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) endmacro() ## Call vendor macro build_mcap_vendor() -ament_export_targets(export_mcap HAS_LIBRARY_TARGET) - +ament_export_include_directories(include/${PROJECT_NAME}) +ament_export_targets(mcap HAS_LIBRARY_TARGET) ament_export_dependencies(zstd_vendor zstd) -## Tests -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - list(APPEND AMENT_LINT_AUTO_EXCLUDE - ament_cmake_uncrustify - ) - ament_lint_auto_find_test_dependencies() -endif() - ## Package ament_package() diff --git a/mcap_vendor/package.xml b/mcap_vendor/package.xml index 9c97a65..239ebe9 100644 --- a/mcap_vendor/package.xml +++ b/mcap_vendor/package.xml @@ -12,10 +12,6 @@ zstd_vendor - ament_cmake_clang_format - ament_lint_auto - ament_lint_common - ament_cmake