From 84dd3d5452bbff29eccb9fee6374ef00247f7fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20Chr=2E=20V=C3=A5ge?= <50892582+ovaag@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:13:36 +0200 Subject: [PATCH] Link pcap nodelet only if BUILD_PCAP is defined (#359) --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa3f3d97..24d25bac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ add_definitions(-DEIGEN_MPL2_ONLY) set(OUSTER_TARGET_LINKS ouster_client) if (BUILD_PCAP) list(APPEND OUSTER_TARGET_LINKS ouster_pcap) + # Include os_pcap_nodelet.cpp only if BUILD_PCAP is defined + set(PCAP_NODELET_SRC src/os_pcap_nodelet.cpp) +else() + set(PCAP_NODELET_SRC "") endif() add_library(ouster_ros src/os_ros.cpp) @@ -91,7 +95,7 @@ add_library(${PROJECT_NAME}_nodelets src/os_sensor_nodelet_base.cpp src/os_sensor_nodelet.cpp src/os_replay_nodelet.cpp - src/os_pcap_nodelet.cpp + ${PCAP_NODELET_SRC} # Include os_pcap_nodelet.cpp only if BUILD_PCAP is defined src/os_cloud_nodelet.cpp src/os_image_nodelet.cpp src/os_driver_nodelet.cpp)