1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:49:56 +00:00
openmw-tes3mp/cmake/FindRakNet.cmake

78 lines
2 KiB
CMake
Raw Normal View History

2016-01-04 12:17:30 +00:00
# Comes form project edunetgames
# - Try to find RakNet
# Once done this will define
#
# RakNet_FOUND - system has RakNet
# RakNet_INCLUDES - the RakNet include directory
# RakNet_LIBRARY - Link these to use RakNet
2016-07-12 12:37:39 +00:00
FIND_LIBRARY (RakNet_LIBRARY_RELEASE NAMES RakNetLibStatic
2016-01-04 12:17:30 +00:00
PATHS
ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
2018-07-05 11:49:33 +00:00
$ENV{RAKNET_ROOT}/lib
2016-01-04 12:17:30 +00:00
)
FIND_LIBRARY (RakNet_LIBRARY_DEBUG NAMES RakNetLibStaticd
2016-01-04 12:17:30 +00:00
PATHS
ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
2018-07-05 11:49:33 +00:00
$ENV{RAKNET_ROOT}/lib
2016-01-04 12:17:30 +00:00
)
FIND_PATH (RakNet_INCLUDES raknet/RakPeer.h
ENV CPATH
/usr/include
/usr/local/include
/opt/local/include
2016-07-12 12:37:39 +00:00
$ENV{RAKNET_ROOT}/include
2016-01-04 12:17:30 +00:00
)
MESSAGE(STATUS ${RakNet_INCLUDES})
MESSAGE(STATUS ${RakNet_LIBRARY_RELEASE})
2016-01-04 12:17:30 +00:00
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}/raknet)
2016-01-04 12:17:30 +00:00
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
SET(RakNet_LIBRARY optimized ${RakNet_LIBRARY_RELEASE} debug ${RakNet_LIBRARY_DEBUG})
IF(WIN32)
SET(RakNet_LIBRARY optimized ${RakNet_LIBRARY_RELEASE} debug ${RakNet_LIBRARY_DEBUG} ws2_32.lib)
ENDIF(WIN32)
ELSE()
2016-01-04 12:17:30 +00:00
# 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} )
IF(WIN32)
SET(RakNet_LIBRARY ${RakNet_LIBRARY_RELEASE} ws2_32.lib)
ENDIF(WIN32)
ENDIF()
2016-01-04 12:17:30 +00:00
IF(NOT RakNet_FIND_QUIETLY)
MESSAGE(STATUS "Found RakNet_LIBRARY_RELEASE: ${RakNet_LIBRARY_RELEASE}")
MESSAGE(STATUS "Found RakNet_INCLUDES: ${RakNet_INCLUDES}")
2016-01-04 12:17:30 +00:00
ENDIF(NOT RakNet_FIND_QUIETLY)
ELSE(RakNet_FOUND)
IF(RakNet_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find RakNet")
ENDIF(RakNet_FIND_REQUIRED)
ENDIF(RakNet_FOUND)