mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-20 09:11:01 +00:00
Added ENet library to SDL2 CMake.
This commit is contained in:
parent
cff9289b07
commit
9e8768e3a2
3 changed files with 39 additions and 0 deletions
34
cmake/Modules/FindENet.cmake
Normal file
34
cmake/Modules/FindENet.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Find ENet
|
||||
# Once done, this will define
|
||||
#
|
||||
# ENET_FOUND - system has SDL2
|
||||
# ENET_INCLUDE_DIRS - SDL2 include directories
|
||||
# ENET_LIBRARIES - link libraries
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_check_modules(ENET_PKGCONF ENET)
|
||||
|
||||
# includes
|
||||
find_path(ENET_INCLUDE_DIR
|
||||
NAMES enet.h
|
||||
PATHS
|
||||
${ENET_PKGCONF_INCLUDE_DIRS}
|
||||
"/usr/include/enet"
|
||||
"/usr/local/include/enet"
|
||||
)
|
||||
|
||||
# library
|
||||
find_library(ENET_LIBRARY
|
||||
NAMES libenet
|
||||
PATHS
|
||||
${ENET_PKGCONF_LIBRARY_DIRS}
|
||||
"/usr/lib"
|
||||
"/usr/local/lib"
|
||||
)
|
||||
|
||||
|
||||
# set include dir variables
|
||||
set(ENET_PROCESS_INCLUDES ENET_INCLUDE_DIR)
|
||||
set(ENET_PROCESS_LIBS ENET_LIBRARY)
|
||||
libfind_process(ENET)
|
|
@ -404,6 +404,8 @@ else()
|
|||
add_definitions(-DNOASM -DNONX86)
|
||||
endif()
|
||||
|
||||
find_package(ENet)
|
||||
|
||||
# Targets
|
||||
|
||||
# Compatibility flag with later versions of GCC
|
||||
|
|
|
@ -125,6 +125,7 @@ if(${SDL2_FOUND})
|
|||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${ENET_LIBRARIES}
|
||||
)
|
||||
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME "Sonic Robo Blast 2")
|
||||
else()
|
||||
|
@ -134,6 +135,7 @@ if(${SDL2_FOUND})
|
|||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${ENET_LIBRARIES}
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES Linux)
|
||||
|
@ -201,6 +203,7 @@ if(${SDL2_FOUND})
|
|||
${PNG_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${OPENGL_INCLUDE_DIRS}
|
||||
${ENET_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(${SRB2_HAVE_MIXER})
|
||||
|
|
Loading…
Reference in a new issue