Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/PackageConfig.cmake @ 3222

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

Merged pch branch back to trunk.

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
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
7SET(DEPENDENCY_VERSION_REQUIRED 2)
8IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
9  SET(DEPENDENCY_VERSION 1.0)
10ELSE()
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()
20ENDIF()
21
22INCLUDE(CompareVersionStrings)
23COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${DEPENDENCY_VERSION_REQUIRED} _result)
24IF(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")
28ENDIF()
29
30MESSAGE(STATUS "Using library package for the dependencies.")
31
32# Include paths and other special treatments
33SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut-1.1.0)
34SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost-1.37.0)
35SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui-0.6.2)
36SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx-2007.aug)
37SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet-1.2)
38SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua-5.1.4)
39SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg-1.1.3)
40SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis-1.2.0)
41SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre-1.4.9)
42SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
43SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal-1.1)
44LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include)
45LIST(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
49IF(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  )
70ENDIF()
Note: See TracBrowser for help on using the repository browser.