mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-23 17:51:11 +00:00
Better CMake support
No idea if it compiles on Mac, it does on Linux though, at least for me.
This commit is contained in:
parent
585cb1cfe3
commit
d9cbb69327
3 changed files with 21 additions and 11 deletions
|
@ -3,11 +3,11 @@ include(LibFindMacros)
|
||||||
libfind_pkg_check_modules(DISCORDRPC_PKGCONF DISCORDRPC)
|
libfind_pkg_check_modules(DISCORDRPC_PKGCONF DISCORDRPC)
|
||||||
|
|
||||||
find_path(DISCORDRPC_INCLUDE_DIR
|
find_path(DISCORDRPC_INCLUDE_DIR
|
||||||
NAMES discord-rpc.h
|
NAMES discord_rpc.h
|
||||||
PATHS
|
PATHS
|
||||||
${DISCORDRPC_PKGCONF_INCLUDE_DIRS}
|
${DISCORDRPC_PKGCONF_INCLUDE_DIRS}
|
||||||
"/usr/include/discord-rpc"
|
"/usr/include"
|
||||||
"/usr/local/include/discord-rpc"
|
"/usr/local/include"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(DISCORDRPC_LIBRARY
|
find_library(DISCORDRPC_LIBRARY
|
||||||
|
@ -20,4 +20,4 @@ find_library(DISCORDRPC_LIBRARY
|
||||||
|
|
||||||
set(DISCORDRPC_PROCESS_INCLUDES DISCORDRPC_INCLUDE_DIR)
|
set(DISCORDRPC_PROCESS_INCLUDES DISCORDRPC_INCLUDE_DIR)
|
||||||
set(DISCORDRPC_PROCESS_LIBS DISCORDRPC_LIBRARY)
|
set(DISCORDRPC_PROCESS_LIBS DISCORDRPC_LIBRARY)
|
||||||
libfind_process(DISCORDRPC)
|
libfind_process(DISCORDRPC)
|
||||||
|
|
|
@ -237,7 +237,7 @@ set(SRB2_CONFIG_STATIC_OPENGL OFF CACHE BOOL
|
||||||
### use internal libraries?
|
### use internal libraries?
|
||||||
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
|
||||||
set(SRB2_CONFIG_USE_INTERNAL_LIBRARIES OFF CACHE BOOL
|
set(SRB2_CONFIG_USE_INTERNAL_LIBRARIES OFF CACHE BOOL
|
||||||
"Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME).")
|
"Use SRB2Kart's internal copies of required dependencies (SDL2, PNG, zlib, GME).")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HAVE_BLUA})
|
if(${SRB2_CONFIG_HAVE_BLUA})
|
||||||
|
@ -359,17 +359,16 @@ if(${SRB2_CONFIG_HAVE_DISCORDRPC})
|
||||||
set(DISCORDRPC_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/discord-rpc/win32-dynamic/lib -ldiscord-rpc")
|
set(DISCORDRPC_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/discord-rpc/win32-dynamic/lib -ldiscord-rpc")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(DISCORDRPC)
|
find_package(DiscordRPC)
|
||||||
endif()
|
endif()
|
||||||
if(${DISCORDRPC_FOUND})
|
if(${DISCORDRPC_FOUND})
|
||||||
set(SRB2_HAVE_DISCORDRPC ON)
|
set(SRB2_HAVE_DISCORDRPC ON)
|
||||||
add_definitions(-DHAVE_DISCORDRPC)
|
add_definitions(-DHAVE_DISCORDRPC)
|
||||||
set(SRB2_DISCORDRPC_SOURCES
|
set(SRB2_DISCORDRPC_SOURCES discord.c)
|
||||||
discord.c
|
set(SRB2_DISCORDRPC_HEADERS discord.h)
|
||||||
discord.h
|
|
||||||
)
|
|
||||||
prepend_sources(SRB2_DISCORDRPC_SOURCES)
|
prepend_sources(SRB2_DISCORDRPC_SOURCES)
|
||||||
source_group("Discord Rich Presence" FILES ${SRB2_DISCORDRPC_SOURCES})
|
prepend_sources(SRB2_DISCORDRPC_HEADERS)
|
||||||
|
source_group("Discord Rich Presence" FILES ${SRB2_DISCORDRPC_SOURCES} ${SRB2_DISCORDRPC_HEADERS})
|
||||||
else()
|
else()
|
||||||
message(WARNING "You have specified that Discord Rich Presence is available but it was not found.")
|
message(WARNING "You have specified that Discord Rich Presence is available but it was not found.")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -70,6 +70,8 @@ if(${SDL2_FOUND})
|
||||||
set(SRB2_SDL2_TOTAL_SOURCES
|
set(SRB2_SDL2_TOTAL_SOURCES
|
||||||
${SRB2_CORE_SOURCES}
|
${SRB2_CORE_SOURCES}
|
||||||
${SRB2_CORE_HEADERS}
|
${SRB2_CORE_HEADERS}
|
||||||
|
${SRB2_DISCORDRPC_SOURCES}
|
||||||
|
${SRB2_DISCORDRPC_HEADERS}
|
||||||
${SRB2_PNG_SOURCES}
|
${SRB2_PNG_SOURCES}
|
||||||
${SRB2_PNG_HEADERS}
|
${SRB2_PNG_HEADERS}
|
||||||
${SRB2_CORE_RENDER_SOURCES}
|
${SRB2_CORE_RENDER_SOURCES}
|
||||||
|
@ -86,9 +88,11 @@ if(${SDL2_FOUND})
|
||||||
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
|
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
|
||||||
source_group("Renderer" FILES ${SRB2_CORE_RENDER_SOURCES})
|
source_group("Renderer" FILES ${SRB2_CORE_RENDER_SOURCES})
|
||||||
source_group("Game" FILES ${SRB2_CORE_GAME_SOURCES})
|
source_group("Game" FILES ${SRB2_CORE_GAME_SOURCES})
|
||||||
|
source_group("Discord Rich Presence" FILES ${SRB2_DISCORDRPC_SOURCES} ${SRB2_DISCORDRPC_HEADERS})
|
||||||
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
|
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
|
||||||
source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
|
source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
|
||||||
source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
|
source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
|
||||||
|
|
||||||
|
|
||||||
if(${SRB2_CONFIG_HWRENDER})
|
if(${SRB2_CONFIG_HWRENDER})
|
||||||
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
|
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
|
||||||
|
@ -153,6 +157,7 @@ if(${SDL2_FOUND})
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${CURL_LIBRARIES}
|
${CURL_LIBRARIES}
|
||||||
|
${DISCORDRPC_LIBRARIES}
|
||||||
)
|
)
|
||||||
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
||||||
else()
|
else()
|
||||||
|
@ -164,6 +169,7 @@ if(${SDL2_FOUND})
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${CURL_LIBRARIES}
|
${CURL_LIBRARIES}
|
||||||
|
${DISCORDRPC_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM} MATCHES Linux)
|
if(${CMAKE_SYSTEM} MATCHES Linux)
|
||||||
|
@ -244,6 +250,7 @@ if(${SDL2_FOUND})
|
||||||
${ZLIB_INCLUDE_DIRS}
|
${ZLIB_INCLUDE_DIRS}
|
||||||
${OPENGL_INCLUDE_DIRS}
|
${OPENGL_INCLUDE_DIRS}
|
||||||
${CURL_INCLUDE_DIRS}
|
${CURL_INCLUDE_DIRS}
|
||||||
|
${DISCORDRPC_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${SRB2_HAVE_MIXER})
|
if(${SRB2_HAVE_MIXER})
|
||||||
|
@ -328,6 +335,10 @@ if(${SDL2_FOUND})
|
||||||
getwinlib(libgme "libgme.dll")
|
getwinlib(libgme "libgme.dll")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${SRB2_CONFIG_HAVE_DISCORDRPC})
|
||||||
|
getwinlib(libgme "discord-rpc.dll")
|
||||||
|
endif()
|
||||||
|
|
||||||
install(PROGRAMS
|
install(PROGRAMS
|
||||||
${win_extra_dll_list}
|
${win_extra_dll_list}
|
||||||
DESTINATION .
|
DESTINATION .
|
||||||
|
|
Loading…
Reference in a new issue