Skip to content
Snippets Groups Projects
Commit 9e8768e3 authored by Yukita Mayako's avatar Yukita Mayako
Browse files

Added ENet library to SDL2 CMake.

parent cff9289b
No related branches found
No related tags found
No related merge requests found
# 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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment