all repos — mgba @ bfe6c021592e4fa921a63191a1110bea3ae366b8

mGBA Game Boy Advance Emulator

src/third-party/discord-rpc/CMakeLists.txt (view raw)

 1cmake_minimum_required (VERSION 3.1.0)
 2project (DiscordRPC)
 3
 4include(GNUInstallDirs)
 5
 6# format
 7file(GLOB_RECURSE ALL_SOURCE_FILES
 8    include/*.h
 9    src/*.cpp src/*.h src/*.c
10)
11
12# thirdparty stuff
13execute_process(
14    COMMAND mkdir ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty
15    ERROR_QUIET
16)
17
18find_file(RAPIDJSONTEST NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH)
19if (NOT RAPIDJSONTEST)
20    message("no rapidjson, download")
21    set(RJ_TAR_FILE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/v1.1.0.tar.gz)
22    file(DOWNLOAD https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz ${RJ_TAR_FILE})
23    execute_process(
24        COMMAND ${CMAKE_COMMAND} -E tar xzf ${RJ_TAR_FILE}
25        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty
26    )
27    file(REMOVE ${RJ_TAR_FILE})
28endif(NOT RAPIDJSONTEST)
29
30find_file(RAPIDJSON NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH)
31
32add_library(rapidjson STATIC IMPORTED ${RAPIDJSON})
33
34# add subdirs
35
36add_subdirectory(src)