Changeset 7421 for sandbox_qt/cmake/PackageConfig.cmake
- Timestamp:
- Sep 12, 2010, 12:47:30 AM (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
sandbox_qt/cmake/PackageConfig.cmake
r7418 r7421 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 SET(ALLOWED_MINIMUM_VERSIONS 3.1 4.0 5.0)34 35 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)36 SET(DEPENDENCY_VERSION 1.0)37 ELSE()38 # Get version from file39 FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)40 SET(_match)41 STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})42 IF(_match)43 SET(DEPENDENCY_VERSION ${_match})44 ELSE()45 MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")46 ENDIF()47 ENDIF()48 49 INCLUDE(CompareVersionStrings)50 SET(_version_match FALSE)51 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})52 # Get major version53 STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")54 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)55 IF(_result EQUAL 0)56 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)57 IF(NOT _result LESS 0)58 SET(_version_match TRUE)59 ENDIF()60 ENDIF()61 ENDFOREACH(_version)62 IF(NOT _version_match)63 MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"64 "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"65 "You can get a new version from www.orxonox.net")66 ENDIF()67 68 27 IF(NOT _INTERNAL_PACKAGE_MESSAGE) 69 28 MESSAGE(STATUS "Using library package for the dependencies.") … … 71 30 ENDIF() 72 31 73 # Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading74 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE)75 IF(NOT _result EQUAL -1 AND NOT MINGW)76 SET(POCO_REQUIRED TRUE)77 ENDIF()78 79 32 # Include paths and other special treatments 80 SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut) 81 SET(ENV{BOOST_ROOT} ${DEP_INCLUDE_DIR}/boost) 82 SET(ENV{CEGUIDIR} ${DEP_INCLUDE_DIR}/cegui) 83 SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx) 84 SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet) 85 SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua) 86 SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg) 87 SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis) 88 SET(ENV{OGRE_HOME} ${DEP_INCLUDE_DIR}/ogre) 89 SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) 90 SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal) 91 SET(ENV{POCODIR} ${DEP_INCLUDE_DIR}/poco) 92 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) 93 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include) 33 #SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut) 34 #LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) 94 35 95 36 ### INSTALL ### 96 97 # Tcl script library98 INSTALL(99 DIRECTORY ${DEP_LIBRARY_DIR}/tcl/100 DESTINATION lib/tcl101 )102 37 103 38 # On Windows, DLLs have to be in the executable folder, install them
Note: See TracChangeset
for help on using the changeset viewer.