Skip to content

Commit

Permalink
Feedback from review.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette committed Apr 3, 2024
1 parent e4db0d7 commit 49566b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion lz4_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(lz4_vendor)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_vendor_package REQUIRED)

ament_add_default_options()

list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
find_package(lz4 QUIET)

Expand All @@ -14,7 +16,7 @@ ament_vendor(lz4_vendor
SOURCE_SUBDIR build/cmake
CMAKE_ARGS
-DBUILD_STATIC_LIBS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DLZ4_BUILD_LEGACY_LZ4C:BOOL=OFF
-DLZ4_BUILD_CLI:BOOL=OFF
)
Expand Down
16 changes: 8 additions & 8 deletions lz4_vendor/cmake/Modules/Findlz4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ if (lz4_INCLUDE_DIR)
list(GET version-file 0 major-line)
list(GET version-file 1 minor-line)
list(GET version-file 2 release-line)
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_MAJOR[ \t]+([0-9]+)$" "\\1" LZ4_VERSION_MAJOR ${major-line})
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_MINOR[ \t]+([0-9]+)$" "\\1" LZ4_VERSION_MINOR ${minor-line})
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_RELEASE[ \t]+([0-9]+)$" "\\1" LZ4_VERSION_RELEASE ${release-line})
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_MAJOR[ \t]+([0-9]+).*$" "\\1" LZ4_VERSION_MAJOR ${major-line})
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_MINOR[ \t]+([0-9]+).*$" "\\1" LZ4_VERSION_MINOR ${minor-line})
string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_RELEASE[ \t]+([0-9]+).*$" "\\1" LZ4_VERSION_RELEASE ${release-line})
set(lz4_VERSION ${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE})
endif()

Expand All @@ -43,12 +43,12 @@ if(lz4_FOUND)
set(lz4_INCLUDE_DIRS ${lz4_INCLUDE_DIR})
set(lz4_LIBRARIES ${lz4_LIBRARY})

if(NOT TARGET lz4::lz4)
add_library(lz4::lz4 UNKNOWN IMPORTED)
set_property(TARGET lz4::lz4 PROPERTY IMPORTED_LOCATION ${lz4_LIBRARY})
set_property(TARGET lz4::lz4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR})
if(NOT TARGET LZ4::lz4)
add_library(LZ4::lz4 UNKNOWN IMPORTED)
set_property(TARGET LZ4::lz4 PROPERTY IMPORTED_LOCATION ${lz4_LIBRARY})
set_property(TARGET LZ4::lz4 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR})
endif()
list(APPEND lz4_TARGETS lz4::lz4)
list(APPEND lz4_TARGETS LZ4::lz4)
elseif(lz4_FIND_REQUIRED)
message(FATAL_ERROR "Unable to find lz4")
endif()
2 changes: 1 addition & 1 deletion mcap_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ macro(build_mcap_vendor)
"$<BUILD_INTERFACE:${_mcap_include_dir}>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(mcap lz4::lz4 zstd::zstd)
target_link_libraries(mcap LZ4::lz4 zstd::zstd)

install(
FILES ${_mcap_installed_headers}
Expand Down

0 comments on commit 49566b6

Please sign in to comment.