mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix finding of discord-rpc
This commit is contained in:
parent
9efe184538
commit
238a46fe5f
|
@ -212,9 +212,12 @@ if (NOT DISABLE_DISCORD_RPC)
|
||||||
include_directories(DISCORDRPC_PROCESS_INCLUDES)
|
include_directories(DISCORDRPC_PROCESS_INCLUDES)
|
||||||
endif()
|
endif()
|
||||||
elseif (APPLE AND MACOS_USE_DEPENDENCIES)
|
elseif (APPLE AND MACOS_USE_DEPENDENCIES)
|
||||||
add_definitions(-D__ENABLE_DISCORD__)
|
find_package(discordrpc CONFIG REQUIRED)
|
||||||
set(HAVE_DISCORD_RPC TRUE)
|
if(${DISCORDRPC_FOUND})
|
||||||
message("Building with libdiscord-rpc.dylib")
|
add_definitions(-D__ENABLE_DISCORD__)
|
||||||
|
set(HAVE_DISCORD_RPC TRUE)
|
||||||
|
message("Building with libdiscord-rpc.dylib")
|
||||||
|
endif()
|
||||||
elseif(NOT HAVE_DISCORD_RPC AND EXISTS "${ROOT_DIR}/discord-rpc")
|
elseif(NOT HAVE_DISCORD_RPC AND EXISTS "${ROOT_DIR}/discord-rpc")
|
||||||
# Don't build discord's examples, some of which are in C and do not honour
|
# Don't build discord's examples, some of which are in C and do not honour
|
||||||
# the flags we set for C++. Also we don't use the provided examples.
|
# the flags we set for C++. Also we don't use the provided examples.
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
# This file is modified from duktapeConfig.cmake
|
||||||
|
|
||||||
|
# - Try to find discordrpc
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# DISCORDRPC_FOUND - system has discordrpc
|
||||||
|
# DISCORDRPC_INCLUDE_DIRS - the discordrpc include directory
|
||||||
|
# DISCORDRPC_LIBRARIES - Link these to use discordrpc
|
||||||
|
# DISCORDRPC_DEFINITIONS - Compiler switches required for using discordrpc
|
||||||
|
#
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(PC_DISCORD_RPC QUIET discord-rpc libdiscord-rpc)
|
||||||
|
|
||||||
|
find_path(DISCORDRPC_INCLUDE_DIR discord_rpc.h
|
||||||
|
HINTS ${PC_DISCORD_RPC_INCLUDEDIR} ${PC_DISCORD_RPC_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES discord-rpc)
|
||||||
|
|
||||||
|
find_library(DISCORDRPC_LIBRARY
|
||||||
|
NAMES discord-rpc libdiscord-rpc
|
||||||
|
HINTS ${PC_DISCORD_RPC_LIBDIR} ${PC_DISCORD_RPC_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(discordrpc
|
||||||
|
REQUIRED_VARS DISCORDRPC_LIBRARY DISCORDRPC_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if (DISCORDRPC_FOUND)
|
||||||
|
set (DISCORDRPC_LIBRARIES ${DISCORDRPC_LIBRARY})
|
||||||
|
set (DISCORDRPC_INCLUDE_DIRS ${DISCORDRPC_INCLUDE_DIR} )
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
DISCORDRPC_INCLUDE_DIR
|
||||||
|
DISCORDRPC_LIBRARY
|
||||||
|
)
|
Loading…
Reference in New Issue