Changeset 8284 for code/branches/kicklib2/cmake/PackageConfig.cmake
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/cmake/PackageConfig.cmake
r8283 r8284 25 25 # 26 26 27 # Check package version info28 # MAJOR: Breaking change29 # MINOR: No breaking changes by the dependency package30 # For example any code running on 3.0 should still run on 3.131 # But you can specify that the code only runs on 3.1 and higher32 # or 4.0 and higher (so both 3.1 and 4.0 will work).33 IF(MSVC)34 SET(ALLOWED_MINIMUM_VERSIONS 4.3 5.1 6.0)35 ELSE()36 SET(ALLOWED_MINIMUM_VERSIONS 4.1 5.2)37 ENDIF()38 39 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)40 SET(DEPENDENCY_VERSION 1.0)41 ELSE()42 # Get version from file43 FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)44 SET(_match)45 STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})46 IF(_match)47 SET(DEPENDENCY_VERSION ${_match})48 ELSE()49 MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")50 ENDIF()51 ENDIF()52 53 INCLUDE(CompareVersionStrings)54 SET(_version_match FALSE)55 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})56 # Get major version57 STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")58 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)59 IF(_result EQUAL 0)60 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)61 IF(NOT _result LESS 0)62 SET(_version_match TRUE)63 ENDIF()64 ENDIF()65 ENDFOREACH(_version)66 IF(NOT _version_match)67 MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"68 "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"69 "You can get a new version from www.orxonox.net")70 ENDIF()71 72 27 IF(NOT _INTERNAL_PACKAGE_MESSAGE) 73 28 MESSAGE(STATUS "Using library package for the dependencies.") … … 77 32 # Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading 78 33 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE) 79 IF(NOT _result EQUAL -1 AND NOT MINGW)80 34 IF(NOT _result EQUAL -1 AND NOT APPLE) 35 SET(POCO_REQUIRED TRUE) 81 36 ENDIF() 82 37
Note: See TracChangeset
for help on using the changeset viewer.