Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Merged resource branch back to the trunk. Changes:

  • Automated graphics loading by evaluating whether a GameState requires it
  • Using native Tcl library (x3n)

Windows users: Update your dependency package!

  • Property svn:eol-style set to native
File size: 2.7 KB
RevLine 
[3167]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
[3370]7SET(DEPENDENCY_VERSION_REQUIRED 3)
[3167]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
[3370]33SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut)
34SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost)
35SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui)
36SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
37SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
38SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
39SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
40SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
41SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre)
[3167]42SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
[3370]43SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal)
44LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include)
45LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include)
[3167]46
47### INSTALL ###
[3370]48
49# Tcl script library
50INSTALL(
51  DIRECTORY ${DEP_LIBRARY_DIR}/tcl/
52  DESTINATION lib/tcl
53)
54
[3167]55# On Windows, DLLs have to be in the executable folder, install them
56IF(WIN32 AND DEP_BINARY_DIR)
57  ## DEBUG
58  # When installing a debug version, we really can't know which libraries
59  # are used in released mode because there might be deps of deps.
60  # --> Copy all of them, except the debug databases
61  INSTALL(
62    DIRECTORY ${DEP_BINARY_DIR}/
63    DESTINATION bin
64    CONFIGURATIONS Debug
65    REGEX "^.*\\.pdb$" EXCLUDE
66  )
67
68  ## RELEASE
69  # Try to filter out all the debug libraries. If the regex doesn't do the
70  # job anymore, simply adjust it.
71  INSTALL(
72    DIRECTORY ${DEP_BINARY_DIR}/
73    DESTINATION bin
74    CONFIGURATIONS Release RelWithDebInfo MinSizeRel
75    REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
76  )
77ENDIF()
Note: See TracBrowser for help on using the repository browser.