| 1 | # General package configuration. Merely sets the include paths. | 
|---|
| 2 | # Library files are treated separately. | 
|---|
| 3 |  | 
|---|
| 4 | # Check package version info | 
|---|
| 5 | # MAJOR: Interface breaking change somewhere (library version changed, etc.) | 
|---|
| 6 | # MINOR: Bug fix or small conformant changes | 
|---|
| 7 | SET(DEPENDENCY_VERSION_REQUIRED 3) | 
|---|
| 8 | IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt) | 
|---|
| 9 |   SET(DEPENDENCY_VERSION 1.0) | 
|---|
| 10 | ELSE() | 
|---|
| 11 |   # Get version from file | 
|---|
| 12 |   FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content) | 
|---|
| 13 |   SET(_match) | 
|---|
| 14 |   STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content}) | 
|---|
| 15 |   IF(_match) | 
|---|
| 16 |     SET(DEPENDENCY_VERSION ${_match}) | 
|---|
| 17 |   ELSE() | 
|---|
| 18 |     MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.") | 
|---|
| 19 |   ENDIF() | 
|---|
| 20 | ENDIF() | 
|---|
| 21 |  | 
|---|
| 22 | INCLUDE(CompareVersionStrings) | 
|---|
| 23 | COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${DEPENDENCY_VERSION_REQUIRED} _result) | 
|---|
| 24 | IF(NOT _result EQUAL 0) | 
|---|
| 25 |   MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n" | 
|---|
| 26 |           "Required version: ${DEPENDENCY_VERSION_REQUIRED}\n" | 
|---|
| 27 |           "You can get a new version from www.orxonox.net") | 
|---|
| 28 | ENDIF() | 
|---|
| 29 |  | 
|---|
| 30 | MESSAGE(STATUS "Using library package for the dependencies.") | 
|---|
| 31 |  | 
|---|
| 32 | # Include paths and other special treatments | 
|---|
| 33 | SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut) | 
|---|
| 34 | SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost) | 
|---|
| 35 | SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui) | 
|---|
| 36 | SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx) | 
|---|
| 37 | SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet) | 
|---|
| 38 | SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua) | 
|---|
| 39 | SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg) | 
|---|
| 40 | SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis) | 
|---|
| 41 | SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre) | 
|---|
| 42 | SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR}) | 
|---|
| 43 | SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal) | 
|---|
| 44 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) | 
|---|
| 45 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include) | 
|---|
| 46 |  | 
|---|
| 47 | ### INSTALL ### | 
|---|
| 48 |  | 
|---|
| 49 | # Tcl script library | 
|---|
| 50 | INSTALL( | 
|---|
| 51 |   DIRECTORY ${DEP_LIBRARY_DIR}/tcl/ | 
|---|
| 52 |   DESTINATION lib/tcl | 
|---|
| 53 | ) | 
|---|
| 54 |  | 
|---|
| 55 | # On Windows, DLLs have to be in the executable folder, install them | 
|---|
| 56 | IF(WIN32 AND DEP_BINARY_DIR) | 
|---|
| 57 |   ## DEBUG | 
|---|
| 58 |   # When installing a debug version, we really can't know which libraries | 
|---|
| 59 |   # are used in released mode because there might be deps of deps. | 
|---|
| 60 |   # --> Copy all of them, except the debug databases | 
|---|
| 61 |   INSTALL( | 
|---|
| 62 |     DIRECTORY ${DEP_BINARY_DIR}/ | 
|---|
| 63 |     DESTINATION bin | 
|---|
| 64 |     CONFIGURATIONS Debug | 
|---|
| 65 |     REGEX "^.*\\.pdb$" EXCLUDE | 
|---|
| 66 |   ) | 
|---|
| 67 |  | 
|---|
| 68 |   ## RELEASE | 
|---|
| 69 |   # Try to filter out all the debug libraries. If the regex doesn't do the | 
|---|
| 70 |   # job anymore, simply adjust it. | 
|---|
| 71 |   INSTALL( | 
|---|
| 72 |     DIRECTORY ${DEP_BINARY_DIR}/ | 
|---|
| 73 |     DESTINATION bin | 
|---|
| 74 |     CONFIGURATIONS Release RelWithDebInfo MinSizeRel | 
|---|
| 75 |     REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE | 
|---|
| 76 |   ) | 
|---|
| 77 | ENDIF() | 
|---|