Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/LibraryConfig.cmake @ 2616

Last change on this file since 2616 was 2616, checked in by rgrieder, 15 years ago
  • 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.
  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
1INCLUDE(LibraryConfigMinGW)
2INCLUDE(LibraryConfigMSVC)
3INCLUDE(LibraryConfigTardis)
4
5############### Library finding #################
6# Performs the search and sets the variables    #
7
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)
34
35##### Lua #####
36IF(CEGUILUA_USE_EXTERNAL_LIBRARY)
37  COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)
38  IF(version_comparison LESS 0)
39    SET(LUA_VERSION_REQUEST 5.0)
40  ELSE(version_comparison LESS 0)
41    SET(LUA_VERSION_REQUEST 5.1)
42  ENDIF(version_comparison LESS 0)
43ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY)
44  SET(LUA_VERSION_REQUEST 5)
45ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY)
46FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
47
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
63MARK_AS_ADVANCED(
64  OPENAL_INCLUDE_DIR
65  OPENAL_LIBRARY
66)
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 TracBrowser for help on using the repository browser.