2017-06-30 19:00:45 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
2017-06-30 23:18:54 +00:00
|
|
|
|
2017-07-25 20:40:30 +00:00
|
|
|
option(ENABLE_IO_THREAD "Start up a separate I/O thread, otherwise I'd need to call an update function" ON)
|
|
|
|
|
|
|
|
if (${ENABLE_IO_THREAD} EQUAL OFF)
|
|
|
|
add_definitions(-DDISCORD_DISABLE_IO_THREAD)
|
|
|
|
endif (${ENABLE_IO_THREAD} EQUAL OFF)
|
|
|
|
|
2017-07-27 18:56:19 +00:00
|
|
|
set(BASE_RPC_SRC ${PROJECT_SOURCE_DIR}/include/discord-rpc.h discord-rpc.cpp discord-register.cpp rpc_connection.h rpc_connection.cpp serialization.h serialization.cpp connection.h backoff.h)
|
2017-06-30 23:18:54 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
2017-07-11 22:59:14 +00:00
|
|
|
add_library(discord-rpc STATIC ${BASE_RPC_SRC} connection_win.cpp)
|
2017-06-30 23:18:54 +00:00
|
|
|
endif(WIN32)
|
2017-07-13 15:32:08 +00:00
|
|
|
|
2017-07-13 17:08:14 +00:00
|
|
|
if(UNIX)
|
|
|
|
add_library(discord-rpc STATIC ${BASE_RPC_SRC} connection_unix.cpp)
|
|
|
|
endif(UNIX)
|
2017-07-17 16:28:54 +00:00
|
|
|
|
2017-07-18 21:29:54 +00:00
|
|
|
target_include_directories(discord-rpc PRIVATE ${RAPIDJSON}/include)
|
2017-07-25 17:15:42 +00:00
|
|
|
|
|
|
|
add_dependencies(discord-rpc clangformat)
|
2017-07-25 23:00:12 +00:00
|
|
|
|
|
|
|
# install
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS discord-rpc
|
|
|
|
EXPORT "discord-rpc"
|
|
|
|
LIBRARY DESTINATION "lib"
|
|
|
|
ARCHIVE DESTINATION "lib"
|
|
|
|
INCLUDES DESTINATION "include"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
"../include/discord-rpc.h"
|
|
|
|
DESTINATION "include"
|
|
|
|
)
|