summaryrefslogtreecommitdiff
path: root/0001-adapt-GeographicLib-discovery-for-openEuler.patch
blob: 246a16de107812351d66bbdb83859f9181b02451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/localizers/easynav_fusion_localizer/CMakeLists.txt
+++ b/localizers/easynav_fusion_localizer/CMakeLists.txt
@@ -32,9 +32,12 @@
 find_package(Eigen3 REQUIRED NO_MODULE)
 find_package(yaets REQUIRED)
 
-# Geographiclib installs FindGeographicLib.cmake to this non-standard location
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/share/cmake/geographiclib/")
-find_package(GeographicLib REQUIRED)
+find_package(GeographicLib CONFIG QUIET)
+if(NOT GeographicLib_FOUND)
+  # GeographicLib may also be provided via a Find module on some distributions.
+  list(APPEND CMAKE_MODULE_PATH "/usr/share/cmake/geographiclib/")
+  find_package(GeographicLib REQUIRED)
+endif()
 
 include_directories(${GeographicLib_INCLUDE_DIRS})