File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,25 @@ find_package(rclcpp REQUIRED)
10
10
find_package (rclcpp_components REQUIRED)
11
11
find_package (sensor_msgs REQUIRED)
12
12
13
- find_package (PkgConfig REQUIRED)
14
- pkg_check_modules (libgps REQUIRED libgps)
13
+ # Try to find libgps, first with CMake's usual library search method, then by
14
+ # querying pkg-config.
15
+ find_library (libgps_LIBRARIES NAMES gps)
16
+ find_path (libgps_INCLUDE_DIRS NAMES libgpsmm.h gps.h)
17
+
18
+ if (NOT libgps_LIBRARIES)
19
+ message (STATUS "Checking pkg-config for libgps" )
20
+ find_package (PkgConfig)
21
+ if (PkgConfig_FOUND)
22
+ pkg_check_modules(libgps libgps)
23
+ endif ()
24
+ endif ()
25
+
26
+ if (NOT libgps_LIBRARIES)
27
+ message (FATAL_ERROR "Could not find libgps "
28
+ "(hint for Debian/Ubuntu: apt install libgps-dev)" )
29
+ else ()
30
+ message (STATUS "Found libgps: ${libgps_LIBRARIES} " )
31
+ endif ()
15
32
16
33
add_library (${PROJECT_NAME} SHARED
17
34
src/client.cpp
You can’t perform that action at this time.
0 commit comments