Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8351 for code/trunk/cmake


Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (14 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
Location:
code/trunk/cmake
Files:
2 deleted
18 edited
6 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/CompilerConfig.cmake

    r5781 r8351  
    3434  MESSAGE(STATUS "Warning: Your compiler is not officially supported.")
    3535ENDIF()
    36 
    37 SET(COMPILER_CONFIG_USER_SCRIPT "" CACHE FILEPATH
    38     "Specify a CMake script if you wish to write your own compiler config.
    39      See CompilerConfigGCC.cmake or CompilerConfigMSVC.cmake for examples.")
    40 IF(COMPILER_CONFIG_USER_SCRIPT)
    41   IF(EXISTS ${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
    42     INCLUDE(${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
    43   ENDIF()
    44 ENDIF(COMPILER_CONFIG_USER_SCRIPT)
  • code/trunk/cmake/CompilerConfigGCC.cmake

    r7458 r8351  
    2626INCLUDE(FlagUtilities)
    2727INCLUDE(CompareVersionStrings)
     28INCLUDE(CheckCXXCompilerFlag)
    2829
    2930# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
     
    3637  OUTPUT_VARIABLE GCC_VERSION
    3738)
    38 
    39 # Complain about incompatibilities
    40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
    41 IF(NOT _compare_result LESS 0)
    42   IF(${Boost_VERSION} LESS 103700)
    43     MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
    44   ENDIF()
    45 ENDIF()
    46 
    47 # GCC may not support #pragma GCC system_header correctly when using
    48 # templates. According to Bugzilla, it was fixed March 07 but tests
    49 # have confirmed that GCC 4.0.0 does not pose a problem for our cases.
    50 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.0.0" _compare_result)
    51 IF(_compare_result LESS 0)
    52   SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)
    53 ENDIF()
    5439
    5540# GCC only supports PCH in versions 3.4 and above
     
    7257
    7358# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
    74 IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
     59IF(NOT MINGW AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
    7560  ADD_COMPILER_FLAGS("-fPIC" CACHE)
     61ENDIF()
     62
     63# Enable non standard floating point optimisations
     64ADD_COMPILER_FLAGS("-ffast-math" CACHE)
     65
     66# Use SSE if possible
     67# Commented because this might not work for cross compiling
     68#CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse)
     69#IF(_gcc_have_sse)
     70#  ADD_COMPILER_FLAGS("-msse" CACHE)
     71#ENDIF()
     72
     73IF(NOT MINGW)
     74  # Have GCC visibility?
     75  CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility)
     76  IF(_gcc_have_visibility)
     77    # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions
     78    COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result)
     79    IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1)
     80      ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE)
     81    ENDIF()
     82  ENDIF(_gcc_have_visibility)
    7683ENDIF()
    7784
    7885# We have some unconformant code, disable an optimisation feature
    7986ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE)
    80 
    81 # For GCC older than version 4, do not display sign compare warnings
    82 # because of boost::filesystem (which creates about a hundred per include)
    83 ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
    8487
    8588# For newer GCC (4.3 and above), don't display hundreds of annoying deprecated
     
    98101ENDIF()
    99102
    100 # General linker flags
    101 SET_LINKER_FLAGS("--no-undefined" CACHE)
     103# Linker flags
     104IF(LINUX)
     105  # Don't allow undefined symbols in a shared library
     106  SET_LINKER_FLAGS("-Wl,--no-undefined" CACHE)
     107ENDIF()
    102108
    103109# Add compiler and linker flags for MinGW
  • code/trunk/cmake/CompilerConfigMSVC.cmake

    r7818 r8351  
    6060
    6161# Overwrite CMake default flags here for the individual configurations
    62 SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -RTC1" Debug          CACHE)
    63 SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG"       Release        CACHE)
    64 SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG"       RelWithDebInfo CACHE)
    65 SET_COMPILER_FLAGS("-MD  -O1     -DNDEBUG"       MinSizeRel     CACHE)
    66 ADD_COMPILER_FLAGS("-D_SECURE_SCL=0"       MSVC9 ReleaseAll     CACHE)
     62SET_COMPILER_FLAGS("-MDd -Od -Oi -Zi -D_DEBUG -RTC1" Debug          CACHE)
     63SET_COMPILER_FLAGS("-MD  -O2         -DNDEBUG"       Release        CACHE)
     64SET_COMPILER_FLAGS("-MD  -O2     -Zi -DNDEBUG"       RelWithDebInfo CACHE)
     65SET_COMPILER_FLAGS("-MD  -O1         -DNDEBUG"       MinSizeRel     CACHE)
     66
     67# Enable non standard floating point optimisations
     68ADD_COMPILER_FLAGS("-fp:fast" CACHE)
    6769
    6870# Use Link time code generation for Release config if ORXONOX_RELEASE is defined
  • code/trunk/cmake/InstallConfig.cmake

    r7163 r8351  
    3939ENDIF()
    4040
    41 # Default installation paths
    42 SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
    43 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
    44 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    45 SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
    46 SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    47 SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
    48 SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
    49 SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
     41# Default relative installation paths
     42SET(RUNTIME_INSTALL_DIRECTORY ${DEFAULT_RUNTIME_PATH})
     43SET(LIBRARY_INSTALL_DIRECTORY ${DEFAULT_LIBRARY_PATH})
     44SET(ARCHIVE_INSTALL_DIRECTORY ${DEFAULT_ARCHIVE_PATH})
     45SET(MODULE_INSTALL_DIRECTORY  ${DEFAULT_MODULE_PATH})
     46SET(DOC_INSTALL_DIRECTORY     ${DEFAULT_DOC_PATH})
     47SET(DATA_INSTALL_DIRECTORY    ${DEFAULT_DATA_PATH})
     48SET(CONFIG_INSTALL_DIRECTORY  ${DEFAULT_CONFIG_PATH})
     49SET(LOG_INSTALL_DIRECTORY     ${DEFAULT_LOG_PATH})
    5050
    5151IF(NOT INSTALL_COPYABLE)
    52   IF(UNIX) # Apple too?
     52  IF(LINUX)
    5353    # Using absolute paths
    54     SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/games)
    55     SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox)
    56     SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static)
    57     SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules)
    58     SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    59     SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/games/orxonox)
     54    SET(RUNTIME_INSTALL_DIRECTORY games)
     55    SET(LIBRARY_INSTALL_DIRECTORY lib/games/orxonox)
     56    SET(ARCHIVE_INSTALL_DIRECTORY lib/games/orxonox/static)
     57    SET(MODULE_INSTALL_DIRECTORY  lib/games/orxonox/modules)
     58    SET(DOC_INSTALL_DIRECTORY     share/doc/orxonox)
     59    SET(DATA_INSTALL_DIRECTORY    share/games/orxonox)
     60  ELSEIF(WIN32)
     61    # Leave on default (installs to only one location anyway)
     62  ELSEIF(APPLE)
     63    # TODO: Figure out what's the best way to install the application
    6064  ENDIF()
    6165
     
    6771################## Unix rpath ###################
    6872
     73# Use, i.e. don't skip the full RPATH for the build tree
     74SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
     75
    6976# When building, don't use the install RPATH already
    7077# (but later on when installing)
     
    7380# The RPATH to be used when installing
    7481IF(INSTALL_COPYABLE)
    75   SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH})
     82  # Get relative paths from run to lib and from module to lib directory.
     83  FILE(RELATIVE_PATH _runtime_rpath "/${RUNTIME_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
     84  FILE(RELATIVE_PATH _module_rpath  "/${MODULE_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
     85  # $ORIGIN (with $ escaped) refers to the actual location of the library
     86  # The UNIX loader recognises this special variable
     87  SET(RUNTIME_RPATH "\$ORIGIN/${_runtime_rpath}")
     88  SET(LIBRARY_RPATH "\$ORIGIN")
     89  SET(MODULE_RPATH  "\$ORIGIN:\$ORIGIN/${_module_rpath}")
    7690ELSE()
    77   SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY})
     91  SET(RUNTIME_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
     92  SET(LIBRARY_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
     93  SET(MODULE_RPATH  "${LIBRARY_RPATH}:${CMAKE_INSTALL_PREFIX}/${MODULE_INSTALL_DIRECTORY}")
    7894ENDIF()
    7995
  • code/trunk/cmake/LibraryConfig.cmake

    r8264 r8351  
    4040# On Windows using a package causes way less problems
    4141SET(_option_msg "Set this to true to use precompiled dependecy archives")
    42 IF(WIN32)
     42IF(WIN32 OR APPLE)
    4343  OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON)
    44 ELSE(WIN32)
     44ELSE()
    4545  OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE)
    46 ENDIF(WIN32)
     46ENDIF()
    4747
    4848# Scripts for specific library and CMake config
    4949INCLUDE(LibraryConfigTardis)
    50 INCLUDE(LibraryConfigApple)
    5150
    5251IF(DEPENDENCY_PACKAGE_ENABLE)
     52  IF(APPLE AND NOT EXISTS ${CMAKE_SOURCE_DIR}/dependencies)
     53    # Let CMake automatically download and extract the dependency package on Mac OS X
     54    # TODO: Handle download errors and always select newest package
     55    SET(_dep_package_current "OrxonoxDeps_110428_2.0_OSX.tar.bz2")
     56    SET(_dep_package_url "http://svn.orxonox.net/ogre/apple/precompiled_dependencies")
     57    MESSAGE(STATUS "Downloading Mac OS X dependency package.")
     58    FILE(DOWNLOAD
     59      ${_dep_package_url}/${_dep_package_current}
     60      ${CMAKE_SOURCE_DIR}/${_dep_package_current}
     61    )
     62    MESSAGE(STATUS "Extracting Mac OS X dependency package.")
     63    EXECUTE_PROCESS(
     64      COMMAND ${CMAKE_COMMAND} -E tar -jxf ${_dep_package_current}
     65      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     66      OUTPUT_FILE ${CMAKE_BINARY_DIR}/dep_pack_extract_log.keep_me
     67    )
     68    # Delete the dependency archive once we no longer need it
     69    FILE(REMOVE ${CMAKE_SOURCE_DIR}/${_dep_package_current})
     70  ENDIF()
     71
    5372  GET_FILENAME_COMPONENT(_dep_dir_1 ${CMAKE_SOURCE_DIR}/../dependencies ABSOLUTE)
    5473  GET_FILENAME_COMPONENT(_dep_dir_2 ${CMAKE_SOURCE_DIR}/../lib_dist ABSOLUTE)
     
    5978  ELSEIF(MSVC90)
    6079    SET(_compiler_prefix msvc9)
     80  ELSEIF(MSVC10)
     81    SET(_compiler_prefix msvc10)
    6182  ENDIF()
    6283  FIND_PATH(DEPENDENCY_PACKAGE_DIR
     
    7394                   "Disable LIBRARY_USE_PACKAGE if you have none intalled.")
    7495  ELSE()
    75     INCLUDE(PackageConfigMinGW)
    76     INCLUDE(PackageConfigMSVC)
    77     INCLUDE(PackageConfig) # For both msvc and mingw
     96    IF(WIN32)
     97      INCLUDE(PackageConfigMinGW)
     98      INCLUDE(PackageConfigMSVC)
     99      INCLUDE(PackageConfig) # For both msvc and mingw
     100    ELSEIF(APPLE)
     101      INCLUDE(PackageConfigOSX)
     102    ENDIF(WIN32)
    78103  ENDIF()
    79104ENDIF(DEPENDENCY_PACKAGE_ENABLE)
     
    93118# Performs the search and sets the variables    #
    94119
    95 FIND_PACKAGE(OGRE  1.4       REQUIRED)
    96 #FIND_PACKAGE(ENet  1.1       REQUIRED)
     120#FIND_PACKAGE(ENet     1.2    REQUIRED)
     121FIND_PACKAGE(CEGUI    0.6    REQUIRED)
     122FIND_PACKAGE(Lua5.1          REQUIRED)
    97123FIND_PACKAGE(Ogg             REQUIRED)
    98124FIND_PACKAGE(Vorbis          REQUIRED)
    99125FIND_PACKAGE(ALUT            REQUIRED)
    100126FIND_PACKAGE(ZLIB            REQUIRED)
    101 IF(POCO_REQUIRED)
    102   FIND_PACKAGE(POCO          REQUIRED)
    103   # Always link against POCO too because of threading
    104   SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY})
    105 ENDIF()
     127
    106128IF(WIN32)
    107129  FIND_PACKAGE(DbgHelp)
     
    109131ENDIF()
    110132
    111 ##### CEGUI #####
    112 # We make use of the CEGUI script module called CEGUILua.
    113 # However there is a small issue with that: We use Tolua, a C++ binding
    114 # generator ourselves. And we also have to use our bindings in the same
    115 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime
    116 # version are equal or else you get segmentation faults.
    117 # In order to match the Lua versions we decided to ship CEGUILua in our
    118 # repository, mainly because there is no way to determine which version of
    119 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly
    120 # because we can then choose the Lua version. Future plans might involve only
    121 # accepting Lua 5.1.
    122 
    123 # Insert all internally supported CEGUILua versions here
    124 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)
    125 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)
    126 FIND_PACKAGE(CEGUI 0.5 REQUIRED)
    127 
    128 ##### Lua #####
    129 IF(CEGUILUA_USE_EXTERNAL_LIBRARY)
    130   COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)
    131   IF(version_comparison LESS 0)
    132     SET(LUA_VERSION_REQUEST 5.0)
    133   ELSE()
    134     SET(LUA_VERSION_REQUEST 5.1)
    135   ENDIF()
    136 ELSE()
    137   SET(LUA_VERSION_REQUEST 5)
    138 ENDIF()
    139 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    140133
    141134##### OpenAL #####
     
    161154
    162155##### Boost #####
    163 # Expand the next statement if newer boost versions than 1.36.1 are released
    164 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0
    165                               1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0)
    166 IF( NOT TARDIS )
    167   FIND_PACKAGE(Boost 1.35 REQUIRED thread filesystem system date_time)
     156# Expand the next statement if newer boost versions are released
     157SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0
     158                              1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1)
     159IF(NOT TARDIS)
     160  FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time)
    168161ENDIF()
    169162# No auto linking, so this option is useless anyway
    170163MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
     164
     165##### OGRE #####
     166FIND_PACKAGE(OGRE 1.6 REQUIRED)
     167# For Ogre >= 1.7, we might need a threading library
     168# Variables are either defined by dependency package config or by FindOGRE
     169IF(OGRE_NEEDS_POCO)
     170  FIND_PACKAGE(POCO REQUIRED)
     171  # Always link against POCO too because of threading
     172  SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY})
     173ELSEIF(OGRE_NEEDS_BOOST)
     174  # Always link against boost too because of threading
     175  SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${Boost_THREAD_LIBRARY})
     176ENDIF()
    171177
    172178
     
    177183# Note: Default option in the libraries vary, but our default option is dynamic
    178184IF(WIN32)
    179   OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE)
    180   OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE)
    181   #OPTION(LINK_ENET_DYNAMIC  "Link ENet dynamically on Windows" TRUE)
    182   OPTION(LINK_OGRE_DYNAMIC  "Link OGRE dynamically on Windows" TRUE)
    183   OPTION(LINK_TCL_DYNAMIC   "Link TCL dynamically on Windows" TRUE)
    184   OPTION(LINK_ZLIB_DYNAMIC  "Link ZLib dynamically on Windows" TRUE)
    185   COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison)
    186   IF(_version_comparison LESS 0)
    187     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE)
    188   ELSE(_version_comparison LESS 0)
    189     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    190   ENDIF(_version_comparison LESS 0)
     185  OPTION(LINK_BOOST_DYNAMIC  "Link Boost dynamically on Windows" TRUE)
     186  OPTION(LINK_CEGUI_DYNAMIC  "Link CEGUI dynamicylly on Windows" TRUE)
     187  #OPTION(LINK_ENET_DYNAMIC   "Link ENet dynamically on Windows" TRUE)
     188  OPTION(LINK_OGRE_DYNAMIC   "Link OGRE dynamically on Windows" TRUE)
     189  OPTION(LINK_TCL_DYNAMIC    "Link TCL dynamically on Windows" TRUE)
     190  OPTION(LINK_ZLIB_DYNAMIC   "Link ZLib dynamically on Windows" TRUE)
     191  OPTION(LINK_LUA5.1_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    191192
    192193  IF(DEPENDENCY_PACKAGE_ENABLE)
     
    194195      LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC
    195196      LINK_OGRE_DYNAMIC  LINK_TCL_DYNAMIC   LINK_ZLIB_DYNAMIC
    196       LINK_LUA_DYNAMIC
     197      LINK_LUA5.1_DYNAMIC
    197198    )
    198199  ENDIF()
  • code/trunk/cmake/LibraryConfigTardis.cmake

    r6746 r8351  
    2525 #
    2626
    27 IF(UNIX AND NOT APPLE)
    28   IF(EXISTS /etc/hostname)
    29     FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
    30     IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
    31       SET (TARDIS ON)
    32     ENDIF()
     27IF(LINUX AND EXISTS /etc/hostname)
     28  FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
     29  IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
     30    SET (TARDIS ON)
    3331  ENDIF()
    3432ENDIF()
     
    7775  #SET(ENV{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    7876  #SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    79   #SET(ENV{LUA_DIR}     "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
     77  #SET(ENV{LUA5.1_DIR}  "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
    8078  #SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")
    8179  #SET(ENV{OPENALDIR}   "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
  • code/trunk/cmake/PackageConfig.cmake

    r7459 r8351  
    2525 #
    2626
    27 # Check package version info
    28 # MAJOR: Breaking change
    29 # MINOR: No breaking changes by the dependency package
    30 #        For example any code running on 3.0 should still run on 3.1
    31 #        But you can specify that the code only runs on 3.1 and higher
    32 #        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 file
    39   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 version
    53   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 
    6827IF(NOT _INTERNAL_PACKAGE_MESSAGE)
    6928  MESSAGE(STATUS "Using library package for the dependencies.")
     
    7332# Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading
    7433COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE)
    75 IF(NOT _result EQUAL -1 AND NOT MINGW)
    76     SET(POCO_REQUIRED TRUE)
     34IF(NOT _result EQUAL -1 AND NOT APPLE)
     35  SET(OGRE_NEEDS_POCO TRUE)
    7736ENDIF()
    7837
     
    8443SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
    8544#SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
    86 SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
     45SET(ENV{LUA5.1_DIR}            ${DEP_INCLUDE_DIR}/lua)
    8746SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
    8847SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
     
    11675
    11776  ## RELEASE
    118   # Try to filter out all the debug libraries. If the regex doesn't do the
    119   # job anymore, simply adjust it.
    120   INSTALL(
    121     DIRECTORY ${DEP_BINARY_DIR}/
    122     DESTINATION bin
    123     CONFIGURATIONS Release RelWithDebInfo MinSizeRel
    124     REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    125   )
     77  IF(EXISTS ${DEP_BINARY_DIR}/install_manifest.txt)
     78    FILE(STRINGS ${DEP_BINARY_DIR}/install_manifest.txt _files)
     79    FOREACH(_file ${_files})
     80      INSTALL(
     81        FILES ${DEP_BINARY_DIR}/${_file}
     82        DESTINATION bin
     83        CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     84      )
     85    ENDFOREACH(_file)
     86  ELSE()
     87    # Try to filter out all the debug libraries. If the regex doesn't do the
     88    # job anymore, simply adjust it.
     89    INSTALL(
     90      DIRECTORY ${DEP_BINARY_DIR}/
     91      DESTINATION bin
     92      CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     93      REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
     94    )
     95  ENDIF()
    12696ENDIF()
  • code/trunk/cmake/PackageConfigMSVC.cmake

    r7818 r8351  
    2828IF(MSVC)
    2929
     30  INCLUDE(CheckPackageVersion)
     31  CHECK_PACKAGE_VERSION(4.3 6.0)
     32
    3033  # 64 bit system?
    3134  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    3639
    3740  # Choose right MSVC version
    38   STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
     41  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
    3942         _msvc_version "${CMAKE_GENERATOR}")
    4043
     
    5457  # Certain find scripts don't behave as ecpected to we have
    5558  # to specify the libraries ourselves.
    56   SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    57   SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     59  IF(MSVC10)
     60    SET(TCL_LIBRARY
     61      optimized ${DEP_LIBRARY_DIR}/tcl85t.lib
     62      debug     ${DEP_LIBRARY_DIR}/tcl85tg.lib
     63      CACHE FILEPATH ""
     64    )
     65    SET(ZLIB_LIBRARY
     66      optimized ${DEP_LIBRARY_DIR}/zlib-vc100.lib
     67      debug     ${DEP_LIBRARY_DIR}/zlib-vc100_d.lib
     68      CACHE FILEPATH ""
     69    )
     70  ELSE()
     71    SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
     72    SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     73  ENDIF()
     74  # Part of Platform SDK and usually gets linked automatically
     75  SET(WMI_LIBRARY  wbemuuid.lib)
    5876
    5977ENDIF(MSVC)
  • code/trunk/cmake/PackageConfigMinGW.cmake

    r5781 r8351  
    2828IF(MINGW)
    2929
     30  INCLUDE(CheckPackageVersion)
     31  CHECK_PACKAGE_VERSION(6.0)
     32
    3033  # 64 bit system?
    3134  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    4851  # to specify the libraries ourselves.
    4952  SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    50   SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
     53  SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/libzlib.dll CACHE FILEPATH "")
     54
     55  # Not included in MinGW, so we need to supply it for OIS
     56  SET(WMI_INCLUDE_DIR ${DEP_INCLUDE_DIR}/wmi/include)
     57  SET(WMI_LIBRARY     ${DEP_LIBRARY_DIR}/wbemuuid.lib)
    5158
    5259ENDIF(MINGW)
  • code/trunk/cmake/tools/CheckOGREPlugins.cmake

    r8264 r8351  
    5252      NAMES ${_plugin}
    5353      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    54       PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin
     54      PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources
    5555    )
    5656    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
    5757      NAMES ${_plugin}d ${_plugin}_d ${_plugin}
    5858      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    59       PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin
     59      PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources
    6060    )
    6161    # We only need at least one render system. Check at the end.
  • code/trunk/cmake/tools/FindALUT.cmake

    r7163 r8351  
    1 # - Locate FreeAlut
    2 # This module defines
    3 #  ALUT_LIBRARY
    4 #  ALUT_FOUND, if false, do not try to link against Alut
    5 #  ALUT_INCLUDE_DIR, where to find the headers
    6 #
    7 # $ALUTDIR is an environment variable that would
    8 # correspond to the ./configure --prefix=$ALUTDIR
    9 # used in building Alut.
    10 #
    11 # Created by Eric Wing. This was influenced by the FindSDL.cmake module.
    12 # On OSX, this will prefer the Framework version (if found) over others.
    13 # People will have to manually change the cache values of
    14 # ALUT_LIBRARY to override this selection.
    15 # Tiger will include OpenAL as part of the System.
    16 # But for now, we have to look around.
    17 # Other (Unix) systems should be able to utilize the non-framework paths.
    18 #
    19 # Several changes and additions by Fabian 'x3n' Landau
    20 # Some simplifications by Adrian Friedli and Reto Grieder
    21 #                 > www.orxonox.net <
     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 #    Kevin Young
     22 #  Description:
     23 #    Variables defined:
     24 #      ALUT_FOUND
     25 #      ALUT_INCLUDE_DIR
     26 #      ALUT_LIBRARY
     27 #
    2228
    2329INCLUDE(FindPackageHandleStandardArgs)
    2430INCLUDE(HandleLibraryTypes)
    2531
    26 FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
    27   PATHS
    28   $ENV{ALUTDIR}
    29   ~/Library/Frameworks/OpenAL.framework
    30   /Library/Frameworks/OpenAL.framework
    31   /System/Library/Frameworks/OpenAL.framework # Tiger
    32   PATH_SUFFIXES include include/OpenAL include/AL Headers
     32FIND_PATH(ALUT_INCLUDE_DIR alut.h
     33  PATHS $ENV{ALUTDIR}
     34  PATH_SUFFIXES include include/AL
    3335)
    34 
    35 # I'm not sure if I should do a special casing for Apple. It is
    36 # unlikely that other Unix systems will find the framework path.
    37 # But if they do ([Next|Open|GNU]Step?),
    38 # do they want the -framework option also?
    39 IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
    40 
    41   STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
    42   IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
    43       OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
    44       )
    45     # String is in default search path, don't need to use -F
    46     SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
    47   ELSE()
    48     # String is not /Library/Frameworks, need to use -F
    49     SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
    50   ENDIF()
    51   # Clear the temp variable so nobody can see it
    52   SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
    53 
    54 ELSE()
    55   FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
    56     NAMES alut
    57     PATHS $ENV{ALUTDIR}
    58     PATH_SUFFIXES lib libs
    59   )
    60   FIND_LIBRARY(ALUT_LIBRARY_DEBUG
    61     NAMES alutd alut_d alutD alut_D
    62     PATHS $ENV{ALUTDIR}
    63     PATH_SUFFIXES lib libs
    64   )
    65 ENDIF()
     36FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
     37  NAMES alut ALUT
     38  PATHS $ENV{ALUTDIR}
     39  PATH_SUFFIXES lib bin/Release bin/release Release release ALUT
     40)
     41FIND_LIBRARY(ALUT_LIBRARY_DEBUG
     42  NAMES alutd alut_d alutD alut_D ALUTd ALUT_d ALUTD ALUT_D
     43  PATHS $ENV{ALUTDIR}
     44  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT
     45)
    6646
    6747# Handle the REQUIRED argument and set ALUT_FOUND
    6848FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
    69     ALUT_LIBRARY_OPTIMIZED
    70     ALUT_INCLUDE_DIR
     49  ALUT_LIBRARY_OPTIMIZED
     50  ALUT_INCLUDE_DIR
    7151)
    7252
     
    7555
    7656MARK_AS_ADVANCED(
    77     ALUT_INCLUDE_DIR
    78     ALUT_LIBRARY_OPTIMIZED
    79     ALUT_LIBRARY_DEBUG
     57  ALUT_INCLUDE_DIR
     58  ALUT_LIBRARY_OPTIMIZED
     59  ALUT_LIBRARY_DEBUG
    8060)
  • code/trunk/cmake/tools/FindCEGUI.cmake

    r7163 r8351  
    44#  CEGUI_INCLUDE_DIR
    55#  CEGUI_LIBRARY, the library to link against to use CEGUI.
     6#  CEGUILUA_LIBRARY, the library to link against to use the CEGUI script module.
     7#  CEGUI_TOLUA_LIBRARY, the library to link against to use Tolua++.
    68#  CEGUI_FOUND, If false, do not try to use CEGUI
    79#  CEGUI_VERSION, the version as string "x.y.z"
    8 #  CEGUILUA_LIBRARY, Script module library
    9 #  CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here
    1010#
    1111# Input:
    1212#  ENV{CEGUIDIR}, CEGUI path, optional
    13 #  FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported
    14 #                                  in the source repository
    15 #  CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua
    1613#
    1714# Created by Matt Williams to find OGRE libraries
     
    2926#                 > www.orxonox.net <
    3027
     28INCLUDE(CompareVersionStrings)
    3129INCLUDE(DetermineVersion)
    3230INCLUDE(FindPackageHandleAdvancedArgs)
    3331INCLUDE(HandleLibraryTypes)
    3432
     33# Find CEGUI headers
    3534FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    3635  PATHS $ENV{CEGUIDIR}
    37   PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers
     36  PATH_SUFFIXES include include/CEGUI
    3837)
     38
     39# Inspect CEGUIVersion.h for the version number
     40DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     41
     42# Find CEGUI library
    3943FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
    4044  NAMES CEGUIBase CEGUI
     
    5054)
    5155
    52 # Inspect CEGUIVersion.h for the version number
    53 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     56# Find CEGUILua headers
     57FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h
     58  PATHS
     59    $ENV{CEGUIDIR}
     60    $ENV{CEGUILUADIR}
     61    ${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule
     62  PATH_SUFFIXES include include/CEGUI
     63)
     64# Find CEGUILua libraries
     65FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
     66  NAMES CEGUILua CEGUILuaScriptModule
     67  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
     68  PATH_SUFFIXES lib bin
     69)
     70FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
     71  NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d
     72  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
     73  PATH_SUFFIXES lib bin
     74)
     75
     76# Find CEGUI Tolua++ include file
     77# We only need to add this path since we use tolua++ like a normal
     78# dependency but it is shipped with CEGUILua.
     79FIND_PATH(CEGUI_TOLUA_INCLUDE_DIR tolua++.h
     80  PATHS
     81    ${CEGUILUA_INCLUDE_DIR}
     82    # For newer CEGUI versions >= 0.7
     83    ${CEGUILUA_INCLUDE_DIR}/support/tolua++
     84    # For Mac OS X, tolua++ is a separate framework in the dependency package
     85    ${DEP_FRAMEWORK_DIR}
     86  NO_DEFAULT_PATH # Don't attempt to find tolua++ installed on the system
     87)
     88# Find CEGUI Tolua++ libraries
     89FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED
     90  NAMES CEGUItoluapp tolua++ ceguitolua++
     91  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
     92  PATH_SUFFIXES lib bin
     93)
     94FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG
     95  NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d
     96  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
     97  PATH_SUFFIXES lib bin
     98)
     99
     100# Newer versions of CEGUI have the renderer for OGRE shipped with them
     101COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
     102IF(_version_compare GREATER -1)
     103  # Find CEGUI OGRE Renderer headers
     104  FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h
     105    PATHS
     106      $ENV{CEGUIDIR}
     107      $ENV{CEGUIOGRERENDERERDIR}
     108      ${CEGUI_INCLUDE_DIR}/RendererModules/Ogre
     109    PATH_SUFFIXES include include/CEGUI
     110  )
     111  # Find CEGUI OGRE Renderer libraries
     112  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     113    NAMES CEGUIOgreRenderer
     114    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
     115    PATH_SUFFIXES lib bin
     116  )
     117  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
     118    NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d
     119    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
     120    PATH_SUFFIXES lib bin
     121  )
     122  SET(CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES
     123    CEGUI_OGRE_RENDERER_INCLUDE_DIR
     124    CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     125  )
     126ELSE()
     127  SET(CEGUI_OLD_VERSION TRUE)
     128  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
     129ENDIF()
    54130
    55131# Handle the REQUIRED argument and set CEGUI_FOUND
    56132# Also checks the version requirements if given
    57133FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
     134  CEGUI_INCLUDE_DIR
    58135  CEGUI_LIBRARY_OPTIMIZED
    59   CEGUI_INCLUDE_DIR
     136  CEGUILUA_INCLUDE_DIR
     137  CEGUILUA_LIBRARY_OPTIMIZED
     138  CEGUI_TOLUA_INCLUDE_DIR
     139  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     140  ${CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES}
    60141)
    61142
    62143# Collect optimized and debug libraries
    63144HANDLE_LIBRARY_TYPES(CEGUI)
     145HANDLE_LIBRARY_TYPES(CEGUILUA)
     146HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
     147IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     148  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
     149ENDIF()
    64150
    65151MARK_AS_ADVANCED(
     
    67153  CEGUI_LIBRARY_OPTIMIZED
    68154  CEGUI_LIBRARY_DEBUG
     155  CEGUILUA_INCLUDE_DIR
     156  CEGUILUA_LIBRARY_OPTIMIZED
     157  CEGUILUA_LIBRARY_DEBUG
     158  CEGUI_TOLUA_INCLUDE_DIR
     159  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     160  CEGUI_TOLUA_LIBRARY_DEBUG
     161  CEGUI_OGRE_RENDERER_INCLUDE_DIR
     162  CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     163  CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
    69164)
    70 
    71 LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)
    72 IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    73   # Also try to find the CEGUILua libraries.
    74   # There would already be libraries in src/ for versions 0.5 and 0.6
    75   FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
    76     NAMES CEGUILua
    77     PATHS $ENV{CEGUIDIR}
    78     PATH_SUFFIXES lib bin
    79   )
    80   FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
    81     NAMES CEGUILuad CEGUILua_d
    82     PATHS $ENV{CEGUIDIR}
    83     PATH_SUFFIXES lib bin
    84   )
    85 
    86   SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})
    87   # Handle the REQUIRED argument and set CEGUILUA_FOUND
    88   FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG
    89     CEGUILUA_LIBRARY_OPTIMIZED
    90   )
    91 
    92   # Collect optimized and debug libraries
    93   HANDLE_LIBRARY_TYPES(CEGUILUA)
    94 
    95   MARK_AS_ADVANCED(
    96     CEGUILUA_LIBRARY_OPTIMIZED
    97     CEGUILUA_LIBRARY_DEBUG
    98   )
    99 
    100 ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    101   SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)
    102 ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    103 
  • code/trunk/cmake/tools/FindOGRE.cmake

    r7163 r8351  
    2323FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
    2424  PATHS $ENV{OGRE_HOME}
    25   PATH_SUFFIXES include include/OGRE Ogre.framework/Headers
     25  PATH_SUFFIXES include include/OGRE
    2626)
    2727FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
     
    3333  NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d
    3434  PATHS $ENV{OGRE_HOME}
    35   PATH_SUFFIXES lib bin/Debug bin/debug Debug debug Versions/A
     35  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
    3636)
    3737
  • code/trunk/cmake/tools/FindOgg.cmake

    r7163 r8351  
    2222)
    2323FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED
    24   NAMES ogg
     24  NAMES ogg ogg-0 libogg
    2525  PATHS $ENV{OGGDIR}
    2626  PATH_SUFFIXES lib
    2727)
    2828FIND_LIBRARY(OGG_LIBRARY_DEBUG
    29   NAMES oggd ogg_d oggD ogg_D
     29  NAMES oggd ogg_d oggD ogg_D libogg_d
    3030  PATHS $ENV{OGGDIR}
    3131  PATH_SUFFIXES lib
  • code/trunk/cmake/tools/FindPOCO.cmake

    r7285 r8351  
    2929FIND_PATH(POCO_INCLUDE_DIR Poco/Poco.h
    3030  PATHS $ENV{POCODIR}
    31   PATH_SUFFIXES include
     31  PATH_SUFFIXES include Foundation/include
    3232)
    3333FIND_LIBRARY(POCO_LIBRARY_OPTIMIZED
  • code/trunk/cmake/tools/FindVorbis.cmake

    r7163 r8351  
    2222)
    2323FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED
    24   NAMES vorbis
     24  NAMES vorbis vorbis-0 libvorbis
    2525  PATHS $ENV{VORBISDIR}
    2626  PATH_SUFFIXES lib
    2727)
    2828FIND_LIBRARY(VORBIS_LIBRARY_DEBUG
    29   NAMES vorbisd vorbis_d vorbisD vorbis_D
     29  NAMES vorbisd vorbis_d vorbisD vorbis_D libvorbis_d
    3030  PATHS $ENV{VORBISDIR}
    3131  PATH_SUFFIXES lib
    3232)
    3333FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED
    34   NAMES vorbisfile
     34  NAMES vorbisfile vorbisfile-3 libvorbisfile
    3535  PATHS $ENV{VORBISDIR}
    3636  PATH_SUFFIXES lib
    3737)
    3838FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG
    39   NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D
     39  NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D libvorbisfile_d
    4040  PATHS $ENV{VORBISDIR}
    4141  PATH_SUFFIXES lib
  • code/trunk/cmake/tools/GenerateToluaBindings.cmake

    r7415 r8351  
    3232 #    RUNTIME_LIBRARY_DIRECTORY - Working directory
    3333 #
     34
     35# Workaround for XCode: The folder where the bind files are written to has
     36# to be present beforehand.
     37# We have to do this here because the header files are all stored in a single
     38# location per configuration.
     39IF(CMAKE_CONFIGURATION_TYPES)
     40  FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
     41    FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}")
     42  ENDFOREACH(_dir)
     43ENDIF()
    3444
    3545FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files)
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r8079 r8351  
    4343 #    Lists:
    4444 #      LINK_LIBRARIES:    Redirects to TARGET_LINK_LIBRARIES
     45 #      LINK_LIBS_LINUX:   Redirects to TARGET_LINK_LIBRARIES only on Linux
     46 #      LINK_LIBS_WIN32:   Redirects to TARGET_LINK_LIBRARIES only on Windows
     47 #      LINK_LIBS_APPLE:   Redirects to TARGET_LINK_LIBRARIES only on Apple
     48 #      LINK_LIBS_UNIX:    Redirects to TARGET_LINK_LIBRARIES only on UNIX
    4549 #      VERSION:           Set version to the binary
    4650 #      SOURCE_FILES:      Source files for the target
     
    5357 #    This function also installs the target!
    5458 #  Prerequisistes:
    55  #    ORXONOX_DEFAULT_LINK, ORXONOX_CONFIG_FILES
     59 #    ORXONOX_DEFAULT_LINK
    5660 #  Parameters:
    5761 #    _target_name, ARGN for the macro arguments
     
    8690  SET(_list_names LINK_LIBRARIES     VERSION           SOURCE_FILES
    8791                  DEFINE_SYMBOL      TOLUA_FILES       PCH_FILE
    88                   PCH_EXCLUDE        OUTPUT_NAME)
     92                  PCH_EXCLUDE        OUTPUT_NAME       LINK_LIBS_LINUX
     93                  LINK_LIBS_WIN32    LINK_LIBS_APPLE   LINK_LIBS_UNIX)
    8994
    9095  PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
     
    104109        MESSAGE(FATAL_ERROR "No name provided for source file compilation")
    105110      ENDIF()
    106       IF(NOT _compilation_include_string)
    107         MESSAGE(STATUS "Warning: Empty source file compilation!")
    108       ENDIF()
    109111      IF(NOT DISABLE_COMPILATIONS)
     112        IF(NOT _compilation_include_string)
     113          MESSAGE(STATUS "Warning: Empty source file compilation!")
     114        ENDIF()
    110115        IF(EXISTS ${_compilation_file})
    111116          FILE(READ ${_compilation_file} _include_string_file)
     
    169174    GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
    170175                            INPUTFILES ${_arg_TOLUA_FILES})
     176    # Workaround for XCode: The folder where the bind files are written to has
     177    # to be present beforehand.
     178    IF(CMAKE_CONFIGURATION_TYPES)
     179      FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
     180        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
     181      ENDFOREACH(_dir)
     182    ENDIF()
    171183  ENDIF()
    172184
     
    192204
    193205    IF(NOT _arg_ORXONOX_EXTERNAL)
    194       # Move the prereqs.h file to the config section
     206      # Move the ...Prereqs.h and the PCH files to the 'Config' section
    195207      IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h)
    196208        SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h)
    197209      ENDIF()
    198       # Add config files to the config section
    199       LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})
    200       SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})
     210      IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE})
     211        SOURCE_GROUP("Config" FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE})
     212      ENDIF()
    201213    ENDIF()
    202214  ENDIF()
     
    217229  IF(_arg_ORXONOX_EXTERNAL)
    218230    REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC)
    219     ADD_COMPILER_FLAGS("-w")
     231    ADD_COMPILER_FLAGS("-w" NOT MSVC)
     232    ADD_COMPILER_FLAGS("-W0" MSVC)
    220233  ENDIF()
    221234
    222235  # Don't compile header files
    223236  FOREACH(_file ${_${_target_name}_files})
    224     IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx)$")
     237    IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$")
    225238      SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
    226239    ENDIF()
     
    278291    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBRARIES})
    279292  ENDIF()
     293  IF(_arg_LINK_LIBS_LINUX AND LINUX)
     294    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_LINUX})
     295  ENDIF()
     296  IF(_arg_LINK_LIBS_WIN32 AND WIN32)
     297    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_WIN32})
     298  ENDIF()
     299  IF(_arg_LINK_LIBS_APPLE AND APPLE)
     300    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_APPLE})
     301  ENDIF()
     302  IF(_arg_LINK_LIBS_UNIX AND UNIX)
     303    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_UNIX})
     304  ENDIF()
     305
     306  # RPATH settings for the installation
     307  IF("${_target_type}" STREQUAL "LIBRARY")
     308    IF(_arg_MODULE)
     309      SET(_rpath "${MODULE_RPATH}")
     310    ELSE()
     311      SET(_rpath "${LIBRARY_RPATH}")
     312    ENDIF()
     313  ELSE()
     314    SET(_rpath "${RUNTIME_RPATH}")
     315  ENDIF()
     316  SET_TARGET_PROPERTIES(${_target_name} PROPERTIES INSTALL_RPATH "${_rpath}")
    280317
    281318  # DEFINE_SYMBOL
Note: See TracChangeset for help on using the changeset viewer.