2021-05-03 22:05:11 +00:00
|
|
|
# DiscordRPC
|
|
|
|
add_library(3rdparty_discordRPC INTERFACE)
|
2021-05-03 20:10:12 +00:00
|
|
|
|
|
|
|
# We don't want Discord Rich Presence on the BSDs and other OSes
|
2021-12-30 16:39:18 +00:00
|
|
|
if (USE_DISCORD_RPC AND (WIN32 OR CMAKE_SYSTEM MATCHES "Linux" OR APPLE) AND COMPILER_X86)
|
2021-05-03 20:10:12 +00:00
|
|
|
if (WIN32 AND NOT MSVC)
|
2021-05-03 22:05:11 +00:00
|
|
|
ExternalProject_Add(discordRPC
|
2021-05-03 20:10:12 +00:00
|
|
|
GIT_REPOSITORY https://github.com/discordapp/discord-rpc
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2021-05-03 22:05:11 +00:00
|
|
|
target_include_directories(3rdparty_discordRPC INTERFACE include)
|
|
|
|
target_compile_definitions(3rdparty_discordRPC INTERFACE -DWITH_DISCORD_RPC)
|
2021-05-03 20:10:12 +00:00
|
|
|
|
|
|
|
set(DISCORD_RPC_LIB NOTFOUND)
|
|
|
|
if (WIN32)
|
|
|
|
if (NOT MSVC)
|
|
|
|
set(DISCORD_RPC_LIB ${CMAKE_CURRENT_BINARY_DIR}/src/libdiscord-rpc.a)
|
|
|
|
else()
|
|
|
|
find_library(DISCORD_RPC_LIB discord-rpc PATHS lib/ NO_DEFAULT_PATH)
|
|
|
|
endif()
|
|
|
|
elseif(CMAKE_SYSTEM MATCHES "Linux")
|
|
|
|
find_library(DISCORD_RPC_LIB discord-rpc-linux PATHS lib/ NO_DEFAULT_PATH)
|
|
|
|
elseif(APPLE)
|
|
|
|
find_library(DISCORD_RPC_LIB discord-rpc-mac PATHS lib/ NO_DEFAULT_PATH)
|
|
|
|
endif()
|
2021-05-03 22:05:11 +00:00
|
|
|
target_link_libraries(3rdparty_discordRPC INTERFACE ${DISCORD_RPC_LIB})
|
2021-05-03 20:10:12 +00:00
|
|
|
if(APPLE)
|
2021-05-03 22:05:11 +00:00
|
|
|
target_link_libraries(3rdparty_discordRPC INTERFACE "objc" "-framework Foundation" "-framework CoreServices")
|
2021-05-03 20:10:12 +00:00
|
|
|
endif()
|
|
|
|
endif()
|