# Init @ variables before doing anything else
@PACKAGE_INIT@

# Dependencies
if(@CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF@)
  include(CMakeFindDependencyMacro)
  # we don't go the Findzstd.cmake route on vcpkg
  if(@CPPTRACE_VCPKG@)
    find_dependency(zstd CONFIG REQUIRED)
  else()
    set(CMAKE_MODULE_PATH_OLD "${CMAKE_MODULE_PATH}")
    set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}")
    find_dependency(zstd)
    set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH_OLD}")
    unset(CMAKE_MODULE_PATH_OLD)
  endif()
  if(NOT @CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG@)
    find_dependency(libdwarf REQUIRED)
  endif()
endif()

# We cannot modify an existing IMPORT target
if(NOT TARGET cpptrace::cpptrace)

  # import targets
  include("${CMAKE_CURRENT_LIST_DIR}/@package_name@-targets.cmake")

endif()

if(@CPPTRACE_STATIC_DEFINE@)
  target_compile_definitions(cpptrace::cpptrace INTERFACE CPPTRACE_STATIC_DEFINE)
endif()
