1
0
Fork 0
flightgear/CMakeModules/FindALUT.cmake
James Turner ffa46f686d Improve ALUT framework detection (for Mac)
Latest Xcode no longer searches /Library/Frameworks by default which exposed an issue here. Search for the header by the correct name to trigger special -F handling in cmake.
2012-06-20 19:45:12 +02:00

67 lines
2 KiB
CMake

# Locate ALUT
# This module defines
# ALUT_LIBRARY
# ALUT_FOUND, if false, do not try to link to ALUT
# ALUT_INCLUDE_DIR, where to find the headers
#
# $ALUTDIR is an environment variable that would
# correspond to the ./configure --prefix=$ALUTDIR
# used in building ALUT.
#
# Created by James Turner. This was influenced by the FindOpenAL.cmake module.
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
FIND_LIBRARY(ALUT_LIBRARY
NAMES ALUT alut
HINTS
$ENV{ALUTDIR}
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt
)
FIND_PATH(ALUT_INCLUDE_DIR
NAMES ALUT/alut.h alut.h
HINTS
$ENV{ALUTDIR}
PATH_SUFFIXES include/AL include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/opt
)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG ALUT_LIBRARY ALUT_INCLUDE_DIR)
MARK_AS_ADVANCED(ALUT_LIBRARY ALUT_INCLUDE_DIR)