Skip to content

Commit

Permalink
cmake: prefer CMake config provided by GeographicLib if available
Browse files Browse the repository at this point in the history
Change-Id: I33cd406be474583f1770f9661bc2163237eeecef
  • Loading branch information
riebl committed Oct 22, 2020
1 parent 8899e5a commit 81798f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake/FindGeographicLib.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
option(GeographicLib_PREFER_PACKAGE_CONFIG "Prefer CMake config mode" ON)
mark_as_advanced(GeographicLib_PREFER_PACKAGE_CONFIG)

if(GeographicLib_PREFER_PACKAGE_CONFIG)
find_package(GeographicLib ${GeographicLib_FIND_VERSION} CONFIG)
if (GeographicLib_FOUND)
message(STATUS "GeographicLib: using found CMake configuration")
return()
endif()
endif()
message(STATUS "GeographicLib: using lookup code by Vanetza")

find_path(GeographicLib_INCLUDE_DIR NAMES GeographicLib/Config.h DOC "GeographicLib include directory")
find_library(GeographicLib_LIBRARY_RELEASE NAMES Geographic DOC "GeographicLib library (release)")
find_library(GeographicLib_LIBRARY_DEBUG NAMES Geographic_d DOC "GeographicLib library (debug)")
Expand Down

0 comments on commit 81798f3

Please sign in to comment.