From 1f0d6eba80fed17d33b0485db5ddea7de5464803 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 2 Aug 2016 18:41:50 +0800 Subject: [PATCH] Fix FindRakNet Added ws2_32 for Windows Fixed path to headers --- cmake/FindRakNet.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmake/FindRakNet.cmake b/cmake/FindRakNet.cmake index f589b25b8..e8eb3de16 100644 --- a/cmake/FindRakNet.cmake +++ b/cmake/FindRakNet.cmake @@ -40,21 +40,31 @@ FIND_PATH (RakNet_INCLUDES raknet/RakPeer.h $ENV{RAKNET_ROOT}/include ) +MESSAGE(STATUS ${RakNet_INCLUDES}) +MESSAGE(STATUS ${RakNet_LIBRARY_RELEASE}) + IF(RakNet_INCLUDES AND RakNet_LIBRARY_RELEASE) SET(RakNet_FOUND TRUE) ENDIF(RakNet_INCLUDES AND RakNet_LIBRARY_RELEASE) IF(RakNet_FOUND) - SET(RakNet_INCLUDES ${RakNet_INCLUDES}) + SET(RakNet_INCLUDES ${RakNet_INCLUDES}/raknet) IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) SET(RakNet_LIBRARY optimized ${RakNet_LIBRARY_RELEASE} debug ${RakNet_LIBRARY_DEBUG}) - ELSE() + IF(WIN32) + SET(RakNet_LIBRARY optimized ${RakNet_LIBRARY_RELEASE} debug ${RakNet_LIBRARY_DEBUG} -lws2_32) + ENDIF(WIN32) + ELSE() # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries SET(RakNet_LIBRARY ${RakNet_LIBRARY_RELEASE} ) - ENDIF() + IF(WIN32) + SET(RakNet_LIBRARY ${RakNet_LIBRARY_RELEASE} -lws2_32) + ENDIF(WIN32) + ENDIF() + IF(NOT RakNet_FIND_QUIETLY) MESSAGE(STATUS "Found RakNet: ${RakNet_LIBRARIES}") ENDIF(NOT RakNet_FIND_QUIETLY)