1 | # General package configuration. Merely sets the include paths. |
---|
2 | # Library files are treated separately. |
---|
3 | |
---|
4 | # Check package version info |
---|
5 | # MAJOR: Interface breaking change somewhere (library version changed, etc.) |
---|
6 | # MINOR: Bug fix or small conformant changes |
---|
7 | SET(DEPENDENCY_VERSION_REQUIRED 2) |
---|
8 | IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt) |
---|
9 | SET(DEPENDENCY_VERSION 1.0) |
---|
10 | ELSE() |
---|
11 | # Get version from file |
---|
12 | FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content) |
---|
13 | SET(_match) |
---|
14 | STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content}) |
---|
15 | IF(_match) |
---|
16 | SET(DEPENDENCY_VERSION ${_match}) |
---|
17 | ELSE() |
---|
18 | MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.") |
---|
19 | ENDIF() |
---|
20 | ENDIF() |
---|
21 | |
---|
22 | INCLUDE(CompareVersionStrings) |
---|
23 | COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${DEPENDENCY_VERSION_REQUIRED} _result) |
---|
24 | IF(NOT _result EQUAL 0) |
---|
25 | MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n" |
---|
26 | "Required version: ${DEPENDENCY_VERSION_REQUIRED}\n" |
---|
27 | "You can get a new version from www.orxonox.net") |
---|
28 | ENDIF() |
---|
29 | |
---|
30 | MESSAGE(STATUS "Using library package for the dependencies.") |
---|
31 | |
---|
32 | # Include paths and other special treatments |
---|
33 | SET(ENV{ALUTDIR} ${DEP_INCLUDE_DIR}/freealut-1.1.0) |
---|
34 | SET(ENV{BOOST_ROOT} ${DEP_INCLUDE_DIR}/boost-1.39.0) |
---|
35 | SET(ENV{CEGUIDIR} ${DEP_INCLUDE_DIR}/cegui-0.6.2) |
---|
36 | SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx-2007.aug) |
---|
37 | SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet-1.2) |
---|
38 | SET(ENV{LUA_DIR} ${DEP_INCLUDE_DIR}/lua-5.1.4) |
---|
39 | SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg-1.1.3) |
---|
40 | SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis-1.2.0) |
---|
41 | SET(ENV{OGRE_HOME} ${DEP_INCLUDE_DIR}/ogre-1.4.9) |
---|
42 | SET(ENV{OGRE_PLUGIN_DIR} ${DEP_BINARY_DIR}) |
---|
43 | SET(ENV{OPENALDIR} ${DEP_INCLUDE_DIR}/openal-1.1) |
---|
44 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include) |
---|
45 | LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include) |
---|
46 | |
---|
47 | ### INSTALL ### |
---|
48 | # On Windows, DLLs have to be in the executable folder, install them |
---|
49 | IF(WIN32 AND DEP_BINARY_DIR) |
---|
50 | ## DEBUG |
---|
51 | # When installing a debug version, we really can't know which libraries |
---|
52 | # are used in released mode because there might be deps of deps. |
---|
53 | # --> Copy all of them, except the debug databases |
---|
54 | INSTALL( |
---|
55 | DIRECTORY ${DEP_BINARY_DIR}/ |
---|
56 | DESTINATION bin |
---|
57 | CONFIGURATIONS Debug |
---|
58 | REGEX "^.*\\.pdb$" EXCLUDE |
---|
59 | ) |
---|
60 | |
---|
61 | ## RELEASE |
---|
62 | # Try to filter out all the debug libraries. If the regex doesn't do the |
---|
63 | # job anymore, simply adjust it. |
---|
64 | INSTALL( |
---|
65 | DIRECTORY ${DEP_BINARY_DIR}/ |
---|
66 | DESTINATION bin |
---|
67 | CONFIGURATIONS Release RelWithDebInfo MinSizeRel |
---|
68 | REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE |
---|
69 | ) |
---|
70 | ENDIF() |
---|