# We explicitly set the desired cmake version to ensure that the policy settings
# of users or of toolchains do not result in the wrong behavior for our modules.
# Note that the call to find_package(~) will PUSH a new policy stack before
# taking on these version settings, and then that stack will POP after the
# find_package(~) has exited, so this will not affect the cmake policy settings
# of a caller.
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

if(@PKG_NAME@_CONFIG_INCLUDED)
  return()
endif()
set(@PKG_NAME@_CONFIG_INCLUDED TRUE)

@PACKAGE_INIT@

if(NOT TARGET @sdf_import_target_name@)
  include("${CMAKE_CURRENT_LIST_DIR}/@sdf_target_output_filename@")
endif()

list(APPEND @PKG_NAME@_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/sdformat-@SDF_VERSION@")

list(APPEND @PKG_NAME@_CFLAGS "-I@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/sdformat-@SDF_VERSION@")
if (NOT WIN32)
  list(APPEND @PKG_NAME@_CXX_FLAGS "${@PKG_NAME@_CFLAGS} -std=c++17")
endif()

list(APPEND @PKG_NAME@_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")

set(@PKG_NAME@_LIBRARIES @sdf_import_target_name@)

# These variables are used by ignition-cmake to automatically configure the
# pkgconfig files for ignition projects.
set(@PROJECT_NAME_LOWER@_PKGCONFIG_ENTRY "@PROJECT_NAME_LOWER@")
set(@PROJECT_NAME_LOWER@_PKGCONFIG_TYPE PKGCONFIG_REQUIRES)

find_package(ignition-math@IGN_MATH_VER@)
list(APPEND @PKG_NAME@_INCLUDE_DIRS ${IGNITION-MATH_INCLUDE_DIRS})
list(APPEND @PKG_NAME@_LIBRARY_DIRS ${IGNITION-MATH_LIBRARY_DIRS})

list(APPEND @PKG_NAME@_LDFLAGS "-L@PACKAGE_CMAKE_INSTALL_LIBDIR@")
