Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/FindALUT.cmake @ 2579

Last change on this file since 2579 was 2579, checked in by rgrieder, 15 years ago
  • Equipped find scripts with debug/optimized functions. If you have different debug prefixes on your platform simply change ${LIBRARY_DEBUG_POSTFIX} ("_d" default).
  • Clean up in ConfigMSVC.cmake and ConfigMinGW.cmake
  • Also had a good look at the MinGW libraries according to the libs_1889_mingw.zip (no warranty at all, hope I got them all)
  • INSTALL commands are currently limited to non Windows platforms (don't yet know why it doesn't work)
  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1# - Locate FreeAlut
2# This module defines
3#  ALUT_LIBRARY
4#  ALUT_FOUND, if false, do not try to link to Alut
5#  ALUT_INCLUDE_DIR, where to find the headers
6#
7# $ALUTDIR is an environment variable that would
8# correspond to the ./configure --prefix=$ALUTDIR
9# used in building Alut.
10#
11# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
12# On OSX, this will prefer the Framework version (if found) over others.
13# People will have to manually change the cache values of
14# ALUT_LIBRARY to override this selection.
15# Tiger will include OpenAL as part of the System.
16# But for now, we have to look around.
17# Other (Unix) systems should be able to utilize the non-framework paths.
18#
19# Several changes and additions by Fabian 'x3n' Landau
20# Some simplifications by Adrian Friedli
21#                 > www.orxonox.net <
22
23SET(ALUT_PATHS
24  $ENV{ALUTDIR}
25  /usr/local
26  /usr
27  /sw        # Fink
28  /opt/local # DarwinPorts
29  /opt/csw   # Blastwave
30  /opt
31)
32
33FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
34  PATHS
35  ${ALUT_PATHS}
36  ~/Library/Frameworks/OpenAL.framework
37  /Library/Frameworks/OpenAL.framework
38  /System/Library/Frameworks/OpenAL.framework # Tiger
39  PATH_SUFFIXES include include/OpenAL include/AL Headers
40)
41
42# I'm not sure if I should do a special casing for Apple. It is
43# unlikely that other Unix systems will find the framework path.
44# But if they do ([Next|Open|GNU]Step?),
45# do they want the -framework option also?
46IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
47
48  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
49  IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
50      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
51      )
52    # String is in default search path, don't need to use -F
53    SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
54  ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
55      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
56      )
57    # String is not /Library/Frameworks, need to use -F
58    SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
59  ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
60    OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
61    )
62  # Clear the temp variable so nobody can see it
63  SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
64
65ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
66  FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
67    NAMES alut
68    PATHS ${ALUT_PATHS}
69    PATH_SUFFIXES lib libs
70  )
71  FIND_LIBRARY(ALUT_LIBRARY_DEBUG
72    NAMES alut_${LIBRARY_DEBUG_POSTFIX}
73    PATHS ${ALUT_PATHS}
74    PATH_SUFFIXES lib libs
75  )
76ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
77
78# handle the QUIETLY and REQUIRED arguments and set ALUT_FOUND to TRUE if
79# all listed variables are TRUE
80FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
81    ALUT_LIBRARY_OPTIMIZED
82    ALUT_INCLUDE_DIR
83)
84
85# Set optimized and debug libraries
86HandleLibraryTypes(ALUT)
87
88MARK_AS_ADVANCED(
89    ALUT_LIBRARY
90    ALUT_LIBRARY_OPTIMIZED
91    ALUT_LIBRARY_DEBUG
92    ALUT_INCLUDE_DIR
93)
Note: See TracBrowser for help on using the repository browser.