File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,25 @@ find_package(catkin REQUIRED COMPONENTS
1111 sensor_msgs
1212)
1313
14- find_package (PkgConfig)
15- pkg_check_modules (libgps REQUIRED libgps)
14+ # Try to find libgps, first with CMake's usual library search method, then by
15+ # querying pkg-config.
16+ find_library (libgps_LIBRARIES NAMES gps)
17+ find_path (libgps_INCLUDE_DIRS NAMES libgpsmm.h gps.h)
18+
19+ if (NOT libgps_LIBRARIES)
20+ message (STATUS "Checking pkg-config for libgps" )
21+ find_package (PkgConfig)
22+ if (PkgConfig_FOUND)
23+ pkg_check_modules(libgps libgps)
24+ endif ()
25+ endif ()
26+
27+ if (NOT libgps_LIBRARIES)
28+ message (FATAL_ERROR "Could not find libgps "
29+ "(hint for Debian/Ubuntu: apt install libgps-dev)" )
30+ else ()
31+ message (STATUS "Found libgps: ${libgps_LIBRARIES} " )
32+ endif ()
1633
1734###################################################
1835## Declare things to be passed to other projects ##
You can’t perform that action at this time.
0 commit comments