Changeset 2577
- Timestamp:
- Jan 7, 2009, 1:22:33 PM (16 years ago)
- Location:
- code/branches/buildsystem2/cmake
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/DetermineVersion.cmake
r2573 r2577 17 17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 18 18 19 MACRO(DetermineVersion _name _file _version_var)19 MACRO(DetermineVersion _name _file) 20 20 FILE(READ ${_file} _file_content) 21 21 IF(_file_content) 22 STRING(REGEX MATCH "${_name}_VERSION_MAJOR +([0-9]+)" _dummyvar ${_file_content}) 23 SET(_version "${CMAKE_MATCH_1}") 24 STRING(REGEX MATCH "${_name}_VERSION_MINOR +([0-9]+)" _dummyvar ${_file_content}) 25 SET(_version "${_version}.${CMAKE_MATCH_1}") 26 STRING(REGEX MATCH "${_name}_VERSION_PATCH +([0-9]+)" _dummyvar ${_file_content}) 27 SET(_version "${_version}.${CMAKE_MATCH_1}") 28 SET(${_version_var} "${_version}") 22 SET(_parts ${ARGN}) 23 LIST(LENGTH _parts _parts_length) 24 IF(NOT ${_parts_length} EQUAL 3) 25 SET(_parts MAJOR MINOR PATCH) 26 ENDIF(NOT ${_parts_length} EQUAL 3) 27 28 FOREACH(_part ${_parts}) 29 STRING(REGEX MATCH "${_name}_VERSION_${_part} +([0-9]+)" _match ${_file_content}) 30 IF(_match) 31 SET(${_name}_VERSION_${_part} ${CMAKE_MATCH_1} CACHE STRING "") 32 ELSE(_match) 33 SET(${_name}_VERSION_${_part} "0" CACHE STRING "") 34 ENDIF(_match) 35 MARK_AS_ADVANCED(${_name}_VERSION_${_part}) 36 IF("${_parts}" MATCHES "^${_part}") # First? 37 SET(${_name}_VERSION "${${_name}_VERSION_${_part}}" CACHE STRING "" FORCE) 38 ELSE("${_parts}" MATCHES "^${_part}") 39 SET(${_name}_VERSION "${${_name}_VERSION}.${${_name}_VERSION_${_part}}" CACHE STRING "" FORCE) 40 ENDIF("${_parts}" MATCHES "^${_part}") 41 ENDFOREACH(_part) 42 MARK_AS_ADVANCED(${_name}_VERSION) 29 43 ENDIF(_file_content) 30 44 ENDMACRO(DetermineVersion) -
code/branches/buildsystem2/cmake/FindCEGUI.cmake
r2576 r2577 60 60 # Look in CEGUIVersion.h for the version number 61 61 INCLUDE(DetermineVersion) 62 DetermineVersion(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h _CEGUI_VERSION_temp) 63 SET(CEGUI_VERSION "${_CEGUI_VERSION_temp}" CACHE STRING "") 62 DetermineVersion(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 64 63 # STRLESS can be dangerous since it only compares strings. 65 # Howerver VERSION_LESS seems to be having serious issues.64 # Unfortunately VERSION_LESS is only provided since CMake v2.6.2 66 65 IF(${CEGUI_VERSION} STRLESS "0.5.0") 67 66 MESSAGE(FATAL_ERROR "Minimum CEGUI version required is 0.5.0")
Note: See TracChangeset
for help on using the changeset viewer.