Changeset 7151 for code/branches/presentation3/cmake/tools/FindENet.cmake
- Timestamp:
- Jun 23, 2010, 6:32:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/cmake/tools/FindENet.cmake
r7139 r7151 34 34 ) 35 35 36 # Try to determine the version. Note that enet only stores the major 37 # version in the header file. So we check for existing functions. 38 # Hence the this script only distinguishes between 1.0, 1.1 and 1.2 39 FILE(STRINGS ${ENET_INCLUDE_DIR}/enet/enet.h _enet_header REGEX "ENET_") 40 IF(_enet_header MATCHES "ENET_VERSION[ \t]*=[ \t]*1") 41 IF(_enet_header MATCHES "enet_socket_set_option") 42 SET(ENET_VERSION 1.2) 43 ELSEIF(_enet_header MATCHES "enet_peer_disconnect_later") 44 SET(ENET_VERSION 1.1) 36 # Only works for 1.2.2 and higher, otherwise see below 37 DETERMINE_VERSION(ENET ${ENET_INCLUDE_DIR}/enet/enet.h) 38 IF(${ENET_VERSION} STREQUAL "0.0.0") 39 # Try to determine the version. Note that enet only stores the major 40 # version in the header file. So we check for existing functions. 41 # Hence the this script only distinguishes between 1.0, 1.1 and 1.2 42 FILE(STRINGS ${ENET_INCLUDE_DIR}/enet/enet.h _enet_header REGEX "ENET_") 43 IF(_enet_header MATCHES "ENET_VERSION[ \t]*=[ \t]*1") 44 IF(_enet_header MATCHES "enet_socket_set_option") 45 SET(ENET_VERSION 1.2) 46 ELSEIF(_enet_header MATCHES "enet_peer_disconnect_later") 47 SET(ENET_VERSION 1.1) 48 ELSE() 49 SET(ENET_VERSION 1.0) 50 ENDIF() 45 51 ELSE() 46 SET(ENET_VERSION 1.0)52 SET(ENET_VERSION 0) # Script doesn't support versions below 1.0 47 53 ENDIF() 48 ELSE()49 SET(ENET_VERSION 0) # Script doesn't support versions below 1.050 54 ENDIF() 51 55 … … 56 60 ENET_INCLUDE_DIR 57 61 ) 62 63 COMPARE_VERSION_STRINGS(${ENET_VERSION} 1.2 _comparison TRUE) 64 IF(${_comparison} EQUAL 1) 65 MESSAGE(STATUS "Warning: Using ENet version 1.3, which is not protocol compatible with 1.1 and 1.2.") 66 ENDIF() 58 67 59 68 # Collect optimized and debug libraries
Note: See TracChangeset
for help on using the changeset viewer.