Skip to content

Commit

Permalink
chore: getting closer to a good cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
hrbrmstr committed Aug 30, 2024
1 parent a202940 commit c1ac4ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.5)

cmake_host_system_information(RESULT DISTRIB_ID QUERY DISTRIB_ID)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(BUILD_MAIN_DUCKDB_LIBRARY FALSE)
Expand All @@ -26,13 +28,22 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/FindPCAP.cmake)
find_package(PCAP REQUIRED)

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(PCAP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux)
include_directories(
SYSTEM
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux/lib
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux/include
)
if(DISTRIB_ID STREQUAL "centos")
set(PCAP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/libpcap_x64-linux)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/libpcap_x64-linux
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/libpcap_x64-linux/lib
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/libpcap_x64-linux/include
)
else()
set(PCAP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux)
include_directories(
SYSTEM
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux/lib
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/installed/x64-linux/include
)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(PCAP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}vcpkg/installed/arm64-osx)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This extension, `ppcap`, allow you to read pcap files.

>Reading [this blog post](https://rud.is/b/2024/08/26/reading-pcap-files-directly-with-duckdb/) is likely a good idea.
Binary versions of this extension are available for amd64 Linux (`linux_amd64`) and Apple Silicon. (`osx_arm64`).
Binary versions of this extension are available for amd64 Linux (`linux_amd64` & `linux_amd64_gcc4`) and Apple Silicon. (`osx_arm64`).

```bash
$ duckdb -unsigned
Expand All @@ -23,7 +23,7 @@ D LOAD ppcap;

---

Only reading local PCAP files is supported.
For now, only reading local PCAP files is supported.

So far, this is what you get:

Expand Down

0 comments on commit c1ac4ed

Please sign in to comment.