| 1 | # |
|---|
| 2 | # ORXONOX - the hottest 3D action shooter ever to exist |
|---|
| 3 | # > www.orxonox.net < |
|---|
| 4 | # |
|---|
| 5 | # This program is free software; you can redistribute it and/or |
|---|
| 6 | # modify it under the terms of the GNU General Public License |
|---|
| 7 | # as published by the Free Software Foundation; either version 2 |
|---|
| 8 | # of the License, or (at your option) any later version. |
|---|
| 9 | # |
|---|
| 10 | # This program is distributed in the hope that it will be useful, |
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | # GNU General Public License for more details. |
|---|
| 14 | # |
|---|
| 15 | # You should have received a copy of the GNU General Public License along |
|---|
| 16 | # with this program; if not, write to the Free Software Foundation, |
|---|
| 17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 18 | # |
|---|
| 19 | # |
|---|
| 20 | # Author: |
|---|
| 21 | # Reto Grieder |
|---|
| 22 | # Description: |
|---|
| 23 | # General package configuration. Merely sets the include paths. |
|---|
| 24 | # Library files are treated separately. |
|---|
| 25 | # |
|---|
| 26 | |
|---|
| 27 | # Check package version info |
|---|
| 28 | # MAJOR: Interface breaking change somewhere (library version changed, etc.) |
|---|
| 29 | # MINOR: Bug fix or small conformant changes |
|---|
| 30 | SET(DEPENDENCY_VERSION_REQUIRED 3) |
|---|
| 31 | IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt) |
|---|
| 32 | SET(DEPENDENCY_VERSION 1.0) |
|---|
| 33 | ELSE() |
|---|
| 34 | # Get version from file |
|---|
| 35 | FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content) |
|---|
| 36 | SET(_match) |
|---|
| 37 | STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content}) |
|---|
| 38 | IF(_match) |
|---|
| 39 | SET(DEPENDENCY_VERSION ${_match}) |
|---|
| 40 | ELSE() |
|---|
| 41 | MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.") |
|---|
| 42 | ENDIF() |
|---|
| 43 | ENDIF() |
|---|
| 44 | |
|---|
| 45 | INCLUDE(CompareVersionStrings) |
|---|
| 46 | COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${DEPENDENCY_VERSION_REQUIRED} _result TRUE) |
|---|
| 47 | IF(NOT _result EQUAL 0) |
|---|
| 48 | MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n" |
|---|
| 49 | "Required version: ${DEPENDENCY_VERSION_REQUIRED}\n" |
|---|
| 50 | "You can get a new version from www.orxonox.net") |
|---|
| 51 | ENDIF() |
|---|
| 52 | |
|---|
| 53 | IF(NOT _INTERNAL_PACKAGE_MESSAGE) |
|---|
| 54 | MESSAGE(STATUS "Using library package for the dependencies.") |
|---|
| 55 | SET(_INTERNAL_PACKAGE_MESSAGE 1 CACHE INTERNAL "Do not edit!" FORCE) |
|---|
| 56 | ENDIF() |
|---|
| 57 | |
|---|
| 58 | # Include paths and other special treatments |
|---|
| 59 | SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut) |
|---|
| 60 | SET(ENV{BOOST_ROOT} ${DEP_INCLUDE_DIR}/boost) |
|---|
| 61 | SET(ENV{CEGUIDIR} ${DEP_INCLUDE_DIR}/cegui) |
|---|
| 62 | SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx) |
|---|
| 63 | SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet) |
|---|
| 64 | SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua) |
|---|
| 65 | SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg) |
|---|
| 66 | SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis) |
|---|
| 67 | SET(ENV{OGRE_HOME} ${DEP_INCLUDE_DIR}/ogre) |
|---|
| 68 | SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) |
|---|
| 69 | SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal) |
|---|
| 70 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include) |
|---|
| 71 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include) |
|---|
| 72 | |
|---|
| 73 | ### INSTALL ### |
|---|
| 74 | |
|---|
| 75 | # Tcl script library |
|---|
| 76 | INSTALL( |
|---|
| 77 | DIRECTORY ${DEP_LIBRARY_DIR}/tcl/ |
|---|
| 78 | DESTINATION lib/tcl |
|---|
| 79 | ) |
|---|
| 80 | |
|---|
| 81 | # On Windows, DLLs have to be in the executable folder, install them |
|---|
| 82 | IF(WIN32 AND DEP_BINARY_DIR) |
|---|
| 83 | ## DEBUG |
|---|
| 84 | # When installing a debug version, we really can't know which libraries |
|---|
| 85 | # are used in released mode because there might be deps of deps. |
|---|
| 86 | # --> Copy all of them, except the debug databases |
|---|
| 87 | INSTALL( |
|---|
| 88 | DIRECTORY ${DEP_BINARY_DIR}/ |
|---|
| 89 | DESTINATION bin |
|---|
| 90 | CONFIGURATIONS Debug |
|---|
| 91 | REGEX "^.*\\.pdb$" EXCLUDE |
|---|
| 92 | ) |
|---|
| 93 | |
|---|
| 94 | ## RELEASE |
|---|
| 95 | # Try to filter out all the debug libraries. If the regex doesn't do the |
|---|
| 96 | # job anymore, simply adjust it. |
|---|
| 97 | INSTALL( |
|---|
| 98 | DIRECTORY ${DEP_BINARY_DIR}/ |
|---|
| 99 | DESTINATION bin |
|---|
| 100 | CONFIGURATIONS Release RelWithDebInfo MinSizeRel |
|---|
| 101 | REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE |
|---|
| 102 | ) |
|---|
| 103 | ENDIF() |
|---|