| 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 | # OS X package configuration |
|---|
| 24 | # |
|---|
| 25 | |
|---|
| 26 | INCLUDE(CheckPackageVersion) |
|---|
| 27 | |
|---|
| 28 | CHECK_PACKAGE_VERSION(1.0) |
|---|
| 29 | |
|---|
| 30 | IF(NOT _INTERNAL_PACKAGE_MESSAGE) |
|---|
| 31 | MESSAGE(STATUS "Using library package for the dependencies.") |
|---|
| 32 | |
|---|
| 33 | # The following shell script sets the appropriate install_names for our libraries |
|---|
| 34 | # and therefore it must be run before anything else is set, dep-package-wise. |
|---|
| 35 | EXECUTE_PROCESS( |
|---|
| 36 | COMMAND ${DEPENDENCY_PACKAGE_DIR}/install_dependencies.sh |
|---|
| 37 | WORKING_DIRECTORY ${DEPENDENCY_PACKAGE_DIR} |
|---|
| 38 | OUTPUT_FILE ${CMAKE_BINARY_DIR}/dep_pack_install_log.keep_me |
|---|
| 39 | ) |
|---|
| 40 | SET(_INTERNAL_PACKAGE_MESSAGE 1 CACHE INTERNAL "Do not edit!" FORCE) |
|---|
| 41 | ENDIF() |
|---|
| 42 | |
|---|
| 43 | SET(DEP_INCLUDE_DIR ${DEPENDENCY_PACKAGE_DIR}/include) |
|---|
| 44 | SET(DEP_LIBRARY_DIR ${DEPENDENCY_PACKAGE_DIR}/lib) |
|---|
| 45 | SET(DEP_BINARY_DIR ${DEPENDENCY_PACKAGE_DIR}/bin) |
|---|
| 46 | SET(DEP_FRAMEWORK_DIR ${DEPENDENCY_PACKAGE_DIR}/Library/Frameworks) |
|---|
| 47 | |
|---|
| 48 | # Sets the library and framwork paths for the FIND_LIBRARY commands |
|---|
| 49 | SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR}) |
|---|
| 50 | SET(CMAKE_FRAMEWORK_PATH ${DEP_FRAMEWORK_DIR}) |
|---|
| 51 | |
|---|
| 52 | # Include paths and other special treatments |
|---|
| 53 | SET(ENV{BOOST_ROOT} ${DEPENDENCY_PACKAGE_DIR}) |
|---|
| 54 | SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}) |
|---|
| 55 | SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}) |
|---|
| 56 | SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) |
|---|
| 57 | |
|---|
| 58 | # Linking to OGRE requires linking to the boost threading library |
|---|
| 59 | SET(OGRE_NEEDS_BOOST TRUE) |
|---|
| 60 | |
|---|
| 61 | # For OS X 10.5 we have to ship modified headers to make it compile |
|---|
| 62 | # on gcc >= 4.2 (binaries stay the same) |
|---|
| 63 | # Sets the library path for the FIND_LIBRARY |
|---|
| 64 | IF(CMAKE_SYSTEM_VERSION STREQUAL "10.5") |
|---|
| 65 | SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal) |
|---|
| 66 | ENDIF() |
|---|
| 67 | |
|---|
| 68 | ### INSTALL ### |
|---|
| 69 | |
|---|
| 70 | # Tcl script library |
|---|
| 71 | # TODO: How does this work on OS X? |
|---|
| 72 | # Concerning all OS X install procedures: use CPACK |
|---|
| 73 | #INSTALL( |
|---|
| 74 | # DIRECTORY ${DEP_LIBRARY_DIR}/tcl/ |
|---|
| 75 | # DESTINATION lib/tcl |
|---|
| 76 | #) |
|---|
| 77 | |
|---|
| 78 | # TODO: Install on OSX |
|---|
| 79 | IF(FALSE) |
|---|
| 80 | ## DEBUG |
|---|
| 81 | # When installing a debug version, we really can't know which libraries |
|---|
| 82 | # are used in released mode because there might be deps of deps. |
|---|
| 83 | # --> Copy all of them, except the debug databases |
|---|
| 84 | INSTALL( |
|---|
| 85 | DIRECTORY ${DEP_BINARY_DIR}/ |
|---|
| 86 | DESTINATION bin |
|---|
| 87 | CONFIGURATIONS Debug |
|---|
| 88 | REGEX "^.*\\.pdb$" EXCLUDE |
|---|
| 89 | ) |
|---|
| 90 | |
|---|
| 91 | ## RELEASE |
|---|
| 92 | # Try to filter out all the debug libraries. If the regex doesn't do the |
|---|
| 93 | # job anymore, simply adjust it. |
|---|
| 94 | INSTALL( |
|---|
| 95 | DIRECTORY ${DEP_BINARY_DIR}/ |
|---|
| 96 | DESTINATION bin |
|---|
| 97 | CONFIGURATIONS Release RelWithDebInfo MinSizeRel |
|---|
| 98 | REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE |
|---|
| 99 | ) |
|---|
| 100 | ENDIF() |
|---|