Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating package search #99

Merged
merged 3 commits into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions gpsd_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@ find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)

find_package(PkgConfig REQUIRED)
pkg_check_modules (libgps REQUIRED libgps)
# Try to find libgps, first with CMake's usual library search method, then by
# querying pkg-config.
find_library(libgps_LIBRARIES NAMES gps)
find_path(libgps_INCLUDE_DIRS NAMES libgpsmm.h gps.h)

if(NOT libgps_LIBRARIES)
message(STATUS "Checking pkg-config for libgps")
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(libgps libgps)
endif()
endif()

if(NOT libgps_LIBRARIES)
message(FATAL_ERROR "Could not find libgps "
"(hint for Debian/Ubuntu: apt install libgps-dev)")
else()
message(STATUS "Found libgps: ${libgps_LIBRARIES}")
endif()

add_library(${PROJECT_NAME} SHARED
src/client.cpp
Expand Down