- Timestamp:
- Jun 23, 2010, 6:32:14 PM (14 years ago)
- Location:
- code/branches/presentation3/cmake/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/cmake/tools/DetermineVersion.cmake
r7139 r7151 22 22 # Description: 23 23 # Inspects a given file for the following expressions 24 # "NAME_ MAJOR_VERSION#"25 # "NAME_ MINOR_VERSION#"26 # "NAME_ PATCH_VERSION#"24 # "NAME_VERSION_MAJOR #" 25 # "NAME_VERSION_MINOR #" 26 # "NAME_VERSION_PATCH #" 27 27 # and sets NAME_VERSION accordingly. NAME_PART_VERSION variables are also 28 28 # set. If you wish to look for different parts (e.g. "first" "second", etc.) -
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.