# This module defines:
#
#  DISCORD_RPC_INCLUDE_DIR
#  DISCORD_RPC_LIBRARY
#  DISCORD_RPC_FOUND
#

FIND_PATH(DISCORD_RPC_INCLUDE_DIR NAMES discord_rpc.h PATH_SUFFIXES discordrpc)

FIND_LIBRARY(DISCORD_RPC_LIBRARY NAMES discord-rpc)

INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(discord_rpc REQUIRED_VARS DISCORD_RPC_LIBRARY DISCORD_RPC_INCLUDE_DIR)

MARK_AS_ADVANCED(DISCORD_RPC_INCLUDE_DIR DISCORD_RPC_LIBRARY)

if(DISCORD_RPC_FOUND AND NOT TARGET discord_rpc::discord_rpc)
    add_library(discord_rpc::discord_rpc INTERFACE IMPORTED)
    set_target_properties(discord_rpc::discord_rpc PROPERTIES
        INTERFACE_INCLUDE_DIRECTORIES "${DISCORD_RPC_INCLUDE_DIR}"
	INTERFACE_LINK_LIBRARIES "${DISCORD_RPC_LIBRARY}"
    )
endif()
