# Version checking for GeographicLib

set (PACKAGE_VERSION "@GeographicLib_VERSION@")
set (PACKAGE_VERSION_MAJOR "@GeographicLib_VERSION_MAJOR@")
set (PACKAGE_VERSION_MINOR "@GeographicLib_VERSION_MINOR@")

if (WIN32 AND NOT "${CMAKE_GENERATOR}" STREQUAL "@CMAKE_GENERATOR@")
  # Reject if there's a mismatch on compiler versions (Windows only)
  set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (PACKAGE_FIND_VERSION)
  if (${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
    set (PACKAGE_VERSION_EXACT TRUE)
  elseif (${PACKAGE_FIND_VERSION} VERSION_LESS ${PACKAGE_VERSION}
    AND ${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${PACKAGE_VERSION_MAJOR})
    set (PACKAGE_VERSION_COMPATIBLE TRUE)
  endif ()
endif ()
