Allow use system enet

This commit is contained in:
proller 2018-08-05 20:54:43 +03:00
parent b3f955f788
commit c29643053e

View File

@ -762,9 +762,17 @@ else()
endif()
if(USE_ENET)
add_subdirectory(external/enet)
include_directories(${PROJECT_SOURCE_DIR}/external/enet/include)
set(ENET_LIBRARY enet)
if(NOT ENABLE_SYSTEM_JSONCPP AND EXISTS ${PROJECT_SOURCE_DIR}/external/enet/include/enet/enet.h)
add_subdirectory(external/enet)
set(ENET_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/external/enet/include)
set(ENET_LIBRARY enet)
endif()
if(NOT ENET_LIBRARY)
find_library(ENET_LIBRARY NAMES enet)
find_path(ENET_INCLUDE_DIR enet/enet.h)
endif()
include_directories(${ENET_INCLUDE_DIR})
message(STATUS "Using enet: ${ENET_INCLUDE_DIR} ${ENET_LIBRARY}")
endif()
set(FMcommon_SRCS