Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 2612 was 2612, checked in by rgrieder, 15 years ago

Rearranged CMake configuration code. I split serveral files in two and moved some code around.
There are no actual code changes!

Details:

  • Everything that involves library finding is in LibraryConfig.cmake. It includes other LibraryConfigXXX.cmake files that set specific options for certain platforms or package configurations (like MSVC or MinGW dependency package).
  • All build related code is in BuildConfig.cmake. The actual compiler configuration is done in BuildConfigXXX.cmake where XXX can be GCC or MSVC.
  • The changes above implied splitting FindOGRE.cmake in two (was going to do it anyway, but rather in a later commit) so that CheckOGREPlugins.cmake is now a separate module.
  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1INCLUDE(LibraryConfigMinGW)
2INCLUDE(LibraryConfigMSVC)
3INCLUDE(LibraryConfigTardis)
4
5# Performs the search and sets the variables
6
7# Expand the next statement if newer boost versions than 1.36.1 are released
8SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
9FIND_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.
13IF (MSVC)
14  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
15ENDIF (MSVC)
16FIND_PACKAGE(OGRE REQUIRED)
17FIND_PACKAGE(CEGUI REQUIRED)
18FIND_PACKAGE(ENet REQUIRED)
19FIND_PACKAGE(OpenAL REQUIRED)
20FIND_PACKAGE(ALUT REQUIRED)
21FIND_PACKAGE(OggVorbis REQUIRED)
22FIND_PACKAGE(ZLIB REQUIRED)
23FIND_PACKAGE(DirectX REQUIRED)
24
25# Require Lua 5.0 or 5.1
26FIND_PACKAGE(Lua50 QUIET)
27IF(NOT LUA50_FOUND)
28  # Remove variables set by Lua50 and try with Lua51
29  SET(LUA_INCLUDE_DIR)
30  SET(LUA_LIBRARY_lua)
31  SET(LUA_LIBRARY_lualib)
32  SET(LUA_LIBRARIES)
33  FIND_PACKAGE(Lua51 REQUIRED)
34ENDIF(NOT LUA50_FOUND)
35# Determine Lua version (Lua50 may also find Lua51)
36FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION")
37STRING(REGEX REPLACE "^.*\"Lua (.*)\".*$" "\\1" LUA_VERSION "${LUA_VERSION}")
38
39# QUIET: Don't require the whole tcl rat tail
40FIND_PACKAGE(TCL QUIET)
41IF(NOT TCL_FOUND)
42  MESSAGE(FATAL_ERROR "Tcl was not found.")
43ENDIF(NOT TCL_FOUND)
44
45# Hide variables created by CMake FindXX scripts
46MARK_AS_ADVANCED(
47  LUA_LIBRARY_lua
48  LUA_LIBRARY_lualib
49  OPENAL_INCLUDE_DIR
50  OPENAL_LIBRARY
51)
Note: See TracBrowser for help on using the repository browser.