# Configure @PROJECT_NAME@
#
# Set
#  @PROJECT_NAME@_FOUND = @PROJECT_NAME_UPPER@_FOUND = 1
#  @PROJECT_NAME@_INCLUDE_DIRS = /usr/local/include
#  @PROJECT_NAME@_SHARED_LIBRARIES = GeographicLib        (or empty)
#  @PROJECT_NAME@_STATIC_LIBRARIES = GeographicLib_STATIC (or empty)
#  @PROJECT_NAME@_SHARED_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=1
#  @PROJECT_NAME@_STATIC_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=0
#  @PROJECT_NAME@_LIBRARY_DIRS = /usr/local/lib
#  @PROJECT_NAME@_BINARY_DIRS = /usr/local/bin
#  @PROJECT_NAME@_VERSION = 1.34 (for example)
#  Depending on @PROJECT_NAME@_USE_STATIC_LIBS
#    @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_SHARED_LIBRARIES}, if OFF
#    @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_STATIC_LIBRARIES}, if ON
#    @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_SHARED_DEFINITIONS}, if OFF
#    @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_STATIC_DEFINITIONS}, if ON
#  If only one of the libraries is provided, then
#    @PROJECT_NAME@_USE_STATIC_LIBS is ignored.
#
# For cmake 2.8.11 or later, there's no need to include
#   include_directories (${GeographicLib_INCLUDE_DIRS})
#   add_definitions (${GeographicLib_DEFINITIONS})

message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
# @PROJECT_NAME@_VERSION is set by version file
message (STATUS
  "@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}")

# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
if (IS_ABSOLUTE "@PROJECT_ROOT_DIR@")
  # This is an uninstalled package (still in the build tree)
  set (_ROOT "@PROJECT_ROOT_DIR@")
  set (@PROJECT_NAME@_INCLUDE_DIRS "@PROJECT_INCLUDE_DIRS@")
  set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/src")
  set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/tools")
else ()
  # This is an installed package; figure out the paths relative to the
  # current directory.
  get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
  set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/include")
  set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/lib@LIB_SUFFIX@")
  set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/bin")
endif ()

set (@PROJECT_NAME@_SHARED_LIBRARIES @PROJECT_SHARED_LIBRARIES@)
set (@PROJECT_NAME@_STATIC_LIBRARIES @PROJECT_STATIC_LIBRARIES@)
set (@PROJECT_NAME@_SHARED_DEFINITIONS @PROJECT_SHARED_DEFINITIONS@)
set (@PROJECT_NAME@_STATIC_DEFINITIONS @PROJECT_STATIC_DEFINITIONS@)
# Read in the exported definition of the library
include ("${_DIR}/@PROJECT_NAME_LOWER@-targets.cmake")

unset (_ROOT)
unset (_DIR)

if ((NOT @PROJECT_NAME@_SHARED_LIBRARIES) OR
    (@PROJECT_NAME@_USE_STATIC_LIBS AND @PROJECT_NAME@_STATIC_LIBRARIES))
  set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_STATIC_LIBRARIES})
  set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_STATIC_DEFINITIONS})
  message (STATUS "  \${@PROJECT_NAME@_LIBRARIES} set to static library")
else ()
  set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_SHARED_LIBRARIES})
  set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_SHARED_DEFINITIONS})
  message (STATUS "  \${@PROJECT_NAME@_LIBRARIES} set to shared library")
endif ()

set (@PROJECT_NAME@_NETGeographicLib_LIBRARIES @NETGEOGRAPHICLIB_LIBRARIES@)

# Check for the components requested.  This only supports components
# STATIC, SHARED, and NETGeographicLib by checking the value of
# @PROJECT_NAME@_${comp}_LIBRARIES.  No need to check if the component
# is required or not--the version file took care of that.
# @PROJECT_NAME@_${comp}_FOUND is set appropriately for each component.
if (@PROJECT_NAME@_FIND_COMPONENTS)
  foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS})
    if (@PROJECT_NAME@_${comp}_LIBRARIES)
      set (@PROJECT_NAME@_${comp}_FOUND 1)
      message (STATUS "@PROJECT_NAME@ component ${comp} found")
    else ()
      set (@PROJECT_NAME@_${comp}_FOUND 0)
      message (WARNING "@PROJECT_NAME@ component ${comp} not found")
    endif ()
  endforeach ()
endif ()

# @PROJECT_NAME@_FOUND is set to 1 automatically
set (@PROJECT_NAME_UPPER@_FOUND 1)     # for backwards compatibility
