Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 14, 2011, 3:53:38 AM (13 years ago)
Author:
rgrieder
Message:

Merged ois_update branch (before it was renamed to mac_osx) into kicklib branch.

Location:
code/branches/kicklib
Files:
1 deleted
11 edited
3 copied

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib

  • code/branches/kicklib/cmake/CompilerConfigGCC.cmake

    r7458 r8071  
    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()
    4639
    4740# GCC may not support #pragma GCC system_header correctly when using
     
    7265
    7366# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
     67# Todo: MinGW too?
    7468IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
    7569  ADD_COMPILER_FLAGS("-fPIC" CACHE)
     70ENDIF()
     71
     72# Use SSE if possible
     73# Commented because this might not work for cross compiling
     74#CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse)
     75#IF(_gcc_have_sse)
     76#  ADD_COMPILER_FLAGS("-msse" CACHE)
     77#ENDIF()
     78
     79IF(NOT MINGW)
     80  # Have GCC visibility?
     81  CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility)
     82  IF(_gcc_have_visibility)
     83    # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions
     84    COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result)
     85    IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1)
     86      ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE)
     87    ENDIF()
     88  ENDIF(_gcc_have_visibility)
    7689ENDIF()
    7790
  • code/branches/kicklib/cmake/CompilerConfigMSVC.cmake

    r8057 r8071  
    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)
     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
     68# Note: It hasn't been checked yet whether we have code that might break
     69#ADD_COMPILER_FLAGS("-fp:fast" CACHE)
    6670
    6771# No iterator checking for release builds (MSVC 8 dosn't understand this though)
  • code/branches/kicklib/cmake/LibraryConfig.cmake

    r8066 r8071  
    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)
     50#INCLUDE(LibraryConfigOSX)
    5151
    5252IF(DEPENDENCY_PACKAGE_ENABLE)
     
    7575                   "Disable LIBRARY_USE_PACKAGE if you have none intalled.")
    7676  ELSE()
    77     INCLUDE(PackageConfigMinGW)
    78     INCLUDE(PackageConfigMSVC)
    79     INCLUDE(PackageConfig) # For both msvc and mingw
     77    IF(WIN32)
     78      INCLUDE(PackageConfigMinGW)
     79      INCLUDE(PackageConfigMSVC)
     80      INCLUDE(PackageConfig) # For both msvc and mingw
     81    ELSEIF(APPLE)
     82      INCLUDE(PackageConfigOSX)
     83    ENDIF(WIN32)
    8084  ENDIF()
    8185ENDIF(DEPENDENCY_PACKAGE_ENABLE)
     
    152156# No auto linking, so this option is useless anyway
    153157MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
     158# Complain about incompatibilities
     159IF(GCC_VERSION)
     160  COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
     161  IF(NOT _compare_result LESS 0)
     162    IF(${Boost_VERSION} LESS 103700)
     163      MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
     164    ENDIF()
     165  ENDIF()
     166ENDIF()
    154167
    155168
  • code/branches/kicklib/cmake/PackageConfig.cmake

    r8064 r8071  
    2424 #    Library files are treated separately.
    2525 #
    26 
    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 IF(MSVC)
    34   SET(ALLOWED_MINIMUM_VERSIONS 4.3 6.0)
    35 ELSE()
    36   SET(ALLOWED_MINIMUM_VERSIONS 6.0)
    37 ENDIF()
    38 
    39 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
    40   SET(DEPENDENCY_VERSION 1.0)
    41 ELSE()
    42   # Get version from file
    43   FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
    44   SET(_match)
    45   STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
    46   IF(_match)
    47     SET(DEPENDENCY_VERSION ${_match})
    48   ELSE()
    49     MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
    50   ENDIF()
    51 ENDIF()
    52 
    53 INCLUDE(CompareVersionStrings)
    54 SET(_version_match FALSE)
    55 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})
    56   # Get major version
    57   STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
    58   COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
    59   IF(_result EQUAL 0)
    60     COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
    61     IF(NOT _result LESS 0)
    62       SET(_version_match TRUE)
    63     ENDIF()
    64   ENDIF()
    65 ENDFOREACH(_version)
    66 IF(NOT _version_match)
    67   MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
    68           "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"
    69           "You can get a new version from www.orxonox.net")
    70 ENDIF()
    7126
    7227IF(NOT _INTERNAL_PACKAGE_MESSAGE)
  • code/branches/kicklib/cmake/PackageConfigMSVC.cmake

    r8057 r8071  
    2727
    2828IF(MSVC)
     29
     30  INCLUDE(CheckPackageVersion)
     31  CHECK_PACKAGE_VERSION(4.3 6.0)
    2932
    3033  # 64 bit system?
  • code/branches/kicklib/cmake/PackageConfigMinGW.cmake

    r8068 r8071  
    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)
  • code/branches/kicklib/cmake/tools/CheckOGREPlugins.cmake

    r7163 r8071  
    5353      NAMES ${_plugin}
    5454      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    55       PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin
     55      PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources
    5656    )
    5757    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
    5858      NAMES ${_plugin}d ${_plugin}_d ${_plugin}
    5959      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    60       PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin
     60      PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources
    6161    )
    6262    # We only need at least one render system. Check at the end.
  • code/branches/kicklib/cmake/tools/FindALUT.cmake

    r7163 r8071  
    1 # - Locate FreeAlut
     1# Find ALUT includes and library
     2#
    23# 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
     4#  ALUT_INCLUDE_DIR
     5#  ALUT_LIBRARY, the library to link against to use ALUT.
     6#  ALUT_FOUND, If false, do not try to use ALUT
    67#
    7 # $ALUTDIR is an environment variable that would
    8 # correspond to the ./configure --prefix=$ALUTDIR
    9 # used in building Alut.
     8# Copyright © 2007, Matt Williams
     9# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture
     10# of the ETH Zurich (removed later on)
    1011#
    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.
     12# Redistribution and use is allowed according to the terms of the BSD license.
    1813#
    1914# Several changes and additions by Fabian 'x3n' Landau
    20 # Some simplifications by Adrian Friedli and Reto Grieder
     15# Lots of simplifications by Adrian Friedli
     16# Version checking by Reto Grieder
     17# Adaption of the OGRE find script to ALUT by Kevin Young
    2118#                 > www.orxonox.net <
    2219
    23 INCLUDE(FindPackageHandleStandardArgs)
     20INCLUDE(FindPackageHandleAdvancedArgs)
    2421INCLUDE(HandleLibraryTypes)
    2522
    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
     23FIND_PATH(ALUT_INCLUDE_DIR alut.h
     24  PATHS $ENV{ALUTDIR}
     25  PATH_SUFFIXES include include/AL ALUT
     26)
     27FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
     28  NAMES ALUT alut
     29  PATHS $ENV{ALUTDIR}
     30  PATH_SUFFIXES lib bin/Release bin/release Release release ALUT
     31)
     32FIND_LIBRARY(ALUT_LIBRARY_DEBUG
     33  NAMES ALUTD alutd alut_d alutD alut_D
     34  PATHS $ENV{ALUTDIR}
     35  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT
    3336)
    3437
    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()
    66 
    6738# Handle the REQUIRED argument and set ALUT_FOUND
    68 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
    69     ALUT_LIBRARY_OPTIMIZED
    70     ALUT_INCLUDE_DIR
     39# Also check the version requirements
     40FIND_PACKAGE_HANDLE_ADVANCED_ARGS(ALUT DEFAULT_MSG
     41  ALUT_LIBRARY_OPTIMIZED
     42  ALUT_INCLUDE_DIR
    7143)
    7244
     
    7547
    7648MARK_AS_ADVANCED(
    77     ALUT_INCLUDE_DIR
    78     ALUT_LIBRARY_OPTIMIZED
    79     ALUT_LIBRARY_DEBUG
     49  ALUT_INCLUDE_DIR
     50  ALUT_LIBRARY_OPTIMIZED
     51  ALUT_LIBRARY_DEBUG
    8052)
  • code/branches/kicklib/cmake/tools/GenerateToluaBindings.cmake

    r7415 r8071  
    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/branches/kicklib/cmake/tools/TargetUtilities.cmake

    r8057 r8071  
    169169    GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
    170170                            INPUTFILES ${_arg_TOLUA_FILES})
     171    # Workaround for XCode: The folder where the bind files are written to has
     172    # to be present beforehand.
     173    IF(CMAKE_CONFIGURATION_TYPES)
     174      FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
     175        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
     176      ENDFOREACH(_dir)
     177    ENDIF()
    171178  ENDIF()
    172179
Note: See TracChangeset for help on using the changeset viewer.