1 | INCLUDE(LibraryConfigMinGW) |
---|
2 | INCLUDE(LibraryConfigMSVC) |
---|
3 | INCLUDE(LibraryConfigTardis) |
---|
4 | |
---|
5 | ############### Library finding ################# |
---|
6 | # Performs the search and sets the variables # |
---|
7 | |
---|
8 | FIND_PACKAGE(OGRE 1.4 EXACT REQUIRED) |
---|
9 | FIND_PACKAGE(ENet 1.1 REQUIRED) |
---|
10 | FIND_PACKAGE(Ogg REQUIRED) |
---|
11 | FIND_PACKAGE(Vorbis REQUIRED) |
---|
12 | FIND_PACKAGE(ALUT REQUIRED) |
---|
13 | FIND_PACKAGE(ZLIB REQUIRED) |
---|
14 | IF(WIN32) |
---|
15 | FIND_PACKAGE(DirectX REQUIRED) |
---|
16 | ENDIF(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 |
---|
31 | SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2) |
---|
32 | OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF) |
---|
33 | FIND_PACKAGE(CEGUI 0.5 REQUIRED) |
---|
34 | |
---|
35 | ##### Lua ##### |
---|
36 | IF(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) |
---|
43 | ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY) |
---|
44 | SET(LUA_VERSION_REQUEST 5) |
---|
45 | ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY) |
---|
46 | FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED) |
---|
47 | |
---|
48 | ##### OpenAL ##### |
---|
49 | FIND_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. |
---|
53 | IF(DEFINED OPENAL_FOUND_FIRST_TIME) |
---|
54 | SET(OPENAL_FOUND_FIRST_TIME FALSE CACHE INTERNAL "") |
---|
55 | ELSE(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) |
---|
61 | ENDIF(DEFINED OPENAL_FOUND_FIRST_TIME) |
---|
62 | # Hide variables created by the script |
---|
63 | MARK_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 |
---|
71 | SET(Tclsh_FIND_QUIETLY TRUE) |
---|
72 | FIND_PACKAGE(TCL 8.4 REQUIRED QUIET) |
---|
73 | # Display messages separately |
---|
74 | SET(TCL_FIND_QUIETLY FALSE) |
---|
75 | FIND_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 |
---|
78 | SET(TCL_LIBRARY ${TCL_LIBRARY} CACHE FILEPATH "") |
---|
79 | SET(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 |
---|
83 | SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0) |
---|
84 | FIND_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. |
---|
88 | IF (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}) |
---|
93 | ENDIF (MSVC) |
---|