Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 10:55:29 PM (16 years ago)
Author:
rgrieder
Message:
  • Split FindOggVorbis.cmake in two. Having them in one file doesn't make sense, we can group it somewhere else.
  • Updated all find scripts
  • Removed all standard paths (like /usr /usr/local, etc.) because they're already searched by CMake anyway
  • Several workarounds for certain libraries when using the find script in the CMake module path.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/cmake/LibraryConfig.cmake

    r2615 r2616  
    33INCLUDE(LibraryConfigTardis)
    44
    5 # Performs the search and sets the variables
     5############### Library finding #################
     6# Performs the search and sets the variables    #
    67
    7 # Expand the next statement if newer boost versions than 1.36.1 are released
    8 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
    9 FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
    10 # With MSVC, automatic linking is performed for boost. So wee need to tell
    11 # the linker where to find them. Also note that when running FindBoost for the
    12 # first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
    13 IF (MSVC)
    14   LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    15 ENDIF (MSVC)
    16 FIND_PACKAGE(OGRE REQUIRED)
    17 FIND_PACKAGE(CEGUI REQUIRED)
    18 FIND_PACKAGE(ENet REQUIRED)
    19 FIND_PACKAGE(OpenAL REQUIRED)
    20 FIND_PACKAGE(ALUT REQUIRED)
    21 FIND_PACKAGE(OggVorbis REQUIRED)
    22 FIND_PACKAGE(ZLIB REQUIRED)
    23 FIND_PACKAGE(DirectX REQUIRED)
     8FIND_PACKAGE(OGRE  1.4 EXACT REQUIRED)
     9FIND_PACKAGE(ENet  1.1       REQUIRED)
     10FIND_PACKAGE(Ogg             REQUIRED)
     11FIND_PACKAGE(Vorbis          REQUIRED)
     12FIND_PACKAGE(ALUT            REQUIRED)
     13FIND_PACKAGE(ZLIB            REQUIRED)
     14IF(WIN32)
     15  FIND_PACKAGE(DirectX       REQUIRED)
     16ENDIF(WIN32)
     17
     18##### CEGUI #####
     19# We make use of the CEGUI script module called CEGUILua.
     20# However there is a small issue with that: We use Tolua, a C++ binding
     21# generator ourselves. And we also have to use our bindings in the same
     22# lua state is CEGUILua's. Unfortunately this implies that both lua runtime
     23# version are equal or else you get segmentation faults.
     24# In order to match the Lua versions we decided to ship CEGUILua in our
     25# repository, mainly because there is no way to determine which version of
     26# Lua CEGUILua was linked against (you'd have to specify yourself) and secondly
     27# because we can then choose the Lua version. Future plans might involve only
     28# accepting Lua 5.1.
     29
     30# Insert all internally supported CEGUILua versions here
     31SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)
     32OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)
     33FIND_PACKAGE(CEGUI 0.5 REQUIRED)
    2434
    2535##### Lua #####
     
    3646FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    3747
    38 # QUIET: Don't require the whole tcl rat tail
    39 FIND_PACKAGE(TCL QUIET)
    40 IF(NOT TCL_FOUND)
    41   MESSAGE(FATAL_ERROR "Tcl was not found.")
    42 ENDIF(NOT TCL_FOUND)
    43 
    44 # Hide variables created by CMake FindXX scripts
     48##### OpenAL #####
     49FIND_PACKAGE(OpenAL REQUIRED)
     50# ALUT's headers include openal headers, but like <AL/al.h>, not <al.h>
     51# Unfortunately this is not the case on all systems, so FindOpenAL.cmake
     52# specifies the directory/AL, which now causes problems with ALUT.
     53IF(DEFINED OPENAL_FOUND_FIRST_TIME)
     54  SET(OPENAL_FOUND_FIRST_TIME FALSE CACHE INTERNAL "")
     55ELSE(DEFINED OPENAL_FOUND_FIRST_TIME)
     56  SET(OPENAL_FOUND_FIRST_TIME TRUE CACHE INTERNAL "")
     57  STRING(REGEX REPLACE "^(.*)/AL$" "\\1" _openal_dir_2 ${OPENAL_INCLUDE_DIR})
     58  IF(_openal_dir_2)
     59    SET(OPENAL_INCLUDE_DIR ${OPENAL_INCLUDE_DIR} ${_openal_dir_2} CACHE STRING "" FORCE)
     60  ENDIF(_openal_dir_2)
     61ENDIF(DEFINED OPENAL_FOUND_FIRST_TIME)
     62# Hide variables created by the script
    4563MARK_AS_ADVANCED(
    46   LUA_LIBRARY_lua
    47   LUA_LIBRARY_lualib
    4864  OPENAL_INCLUDE_DIR
    4965  OPENAL_LIBRARY
    5066)
     67
     68##### TCL #####
     69# We only require TCL, so avoid confusing user about other TCL stuff by
     70# applying a little workaround
     71SET(Tclsh_FIND_QUIETLY TRUE)
     72FIND_PACKAGE(TCL 8.4 REQUIRED QUIET)
     73# Display messages separately
     74SET(TCL_FIND_QUIETLY FALSE)
     75FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
     76# Workaround a CMake bug that doesn't set the variables to the cache
     77# Occurs at least on CMake 2.6.2 and 2.6.0 under Windows
     78SET(TCL_LIBRARY ${TCL_LIBRARY} CACHE FILEPATH "")
     79SET(TCL_INCLUDE_PATH ${TCL_INCLUDE_PATH} CACHE PATH "")
     80
     81##### Boost #####
     82# Expand the next statement if newer boost versions than 1.36.1 are released
     83SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0)
     84FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
     85# With MSVC, automatic linking is performed for boost. So wee need to tell
     86# the linker where to find them. Also note that when running FindBoost for the
     87# first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
     88IF (MSVC)
     89  # Little bit hacky, but Boost_LIBRARY_DIRS doesn't get set right when having
     90  # debug and optimized libraries.
     91  GET_FILENAME_COMPONENT(BOOST_LINK_DIR "${Boost_THREAD_LIBRARY_RELEASE}" PATH)
     92  LINK_DIRECTORIES(${BOOST_LINK_DIR})
     93ENDIF (MSVC)
Note: See TracChangeset for help on using the changeset viewer.