| 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 | # Sets the library directories when using precompiled dependency archives |
|---|
| 24 | # Note: |
|---|
| 25 | # When setting ENV${} variables, make sure to use quotes for lists |
|---|
| 26 | # |
|---|
| 27 | |
|---|
| 28 | IF(MSVC) |
|---|
| 29 | |
|---|
| 30 | # MAJOR: Interface breaking change somewhere or added a new library |
|---|
| 31 | # MINOR: Updated a library to a new version |
|---|
| 32 | # PATCH: Bug fix or smaller things |
|---|
| 33 | SET(DEPENDENCY_VERSION 0.0.1) |
|---|
| 34 | |
|---|
| 35 | MESSAGE(STATUS "Using library package for the dependencies.") |
|---|
| 36 | |
|---|
| 37 | # 64 bit system? |
|---|
| 38 | IF(CMAKE_SIZEOF_VOID_P EQUAL 8) |
|---|
| 39 | SET(BINARY_POSTFIX x64) |
|---|
| 40 | ELSE() |
|---|
| 41 | SET(BINARY_POSTFIX x86) |
|---|
| 42 | ENDIF() |
|---|
| 43 | |
|---|
| 44 | # Choose right MSVC version |
|---|
| 45 | STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1" |
|---|
| 46 | _msvc_version "${CMAKE_GENERATOR}") |
|---|
| 47 | IF(MSVC71) |
|---|
| 48 | SET(_msvc_version "7.1") |
|---|
| 49 | ENDIF(MSVC71) |
|---|
| 50 | |
|---|
| 51 | SET(DEP_INCLUDE_DIR ${DEPENDENCY_PACKAGE_DIR}/include) |
|---|
| 52 | SET(DEP_LIBRARY_DIR ${DEPENDENCY_PACKAGE_DIR}/lib/msvc${_msvc_version}-${BINARY_POSTFIX}) |
|---|
| 53 | SET(DEP_BINARY_DIR ${DEPENDENCY_PACKAGE_DIR}/bin/msvc${_msvc_version}-${BINARY_POSTFIX}) |
|---|
| 54 | IF(NOT EXISTS ${DEP_LIBRARY_DIR}) |
|---|
| 55 | message(FATAL_ERROR "No binaries found for your MSVC Version (${CMAKE_GENERATOR})") |
|---|
| 56 | ENDIF() |
|---|
| 57 | |
|---|
| 58 | # Also the directory with the runtime libraries |
|---|
| 59 | SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${DEP_BINARY_DIR}) |
|---|
| 60 | |
|---|
| 61 | # Sets the library path for the FIND_LIBRARY |
|---|
| 62 | SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR}) |
|---|
| 63 | |
|---|
| 64 | # Include paths and other special treatments |
|---|
| 65 | SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut-1.1.0) |
|---|
| 66 | SET(ENV{BOOST_ROOT} ${DEP_INCLUDE_DIR}/boost-1.37.0) |
|---|
| 67 | SET(ENV{CEGUIDIR} ${DEP_INCLUDE_DIR}/cegui-0.6.2) |
|---|
| 68 | SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx-2007.aug) |
|---|
| 69 | SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet-1.2) |
|---|
| 70 | SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua-5.1.4) |
|---|
| 71 | SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg-1.1.3) |
|---|
| 72 | SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis-1.2.0) |
|---|
| 73 | SET(ENV{OGRE_HOME} ${DEP_INCLUDE_DIR}/ogre-1.4.9) |
|---|
| 74 | SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) |
|---|
| 75 | SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal-1.1) |
|---|
| 76 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include) |
|---|
| 77 | SET(TCL_LIBRARY ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "") |
|---|
| 78 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include) |
|---|
| 79 | SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "") |
|---|
| 80 | |
|---|
| 81 | ENDIF(MSVC) |
|---|