61 lines
1.9 KiB
CMake
61 lines
1.9 KiB
CMake
# - Find OPENAL
|
|
# Find the native OPENAL headers
|
|
#
|
|
# OPENAL_INCLUDE_DIR - where to find OPENAL.h, etc.
|
|
# OPENAL_LIBRARIES - OPENAL library
|
|
# OPENAL_FOUND - True if OPENAL found.
|
|
|
|
IF(OPENAL_FOUND)
|
|
# Already in cache, be silent
|
|
SET(OPENAL_FIND_QUIETLY TRUE)
|
|
ENDIF()
|
|
|
|
IF(BUILD_OPENAL OR ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME OR BUILD_TYPE_CHANGED)
|
|
UNSET(OPENAL_INCLUDE_DIR CACHE)
|
|
UNSET(OPENAL_LIBRARIES CACHE)
|
|
ENDIF()
|
|
|
|
IF(BUILD_OPENAL)
|
|
SET(OPENAL_INCLUDE_DIR "${ACGL_LOCAL_EXTERN_DIR}/openal/include")
|
|
SET(OPENAL_LIBRARIES openal${COMPILE_POSTFIX})
|
|
ELSE()
|
|
# Look for the header file.
|
|
IF(ACGL_GLOBAL_EXTERN_DIR)
|
|
FIND_PATH(OPENAL_INCLUDE_DIR NAMES AL/al.h PATHS "${ACGL_GLOBAL_EXTERN_DIR}/openal/include" NO_DEFAULT_PATH)
|
|
ENDIF()
|
|
IF(NOT OPENAL_INCLUDE_DIR)
|
|
FIND_PATH(OPENAL_INCLUDE_DIR NAMES AL/al.h)
|
|
ENDIF()
|
|
|
|
# Look for the library file.
|
|
IF(ACGL_GLOBAL_EXTERN_DIR)
|
|
FIND_LIBRARY(OPENAL_LIBRARIES NAMES openal${COMPILE_POSTFIX} PATHS "${ACGL_GLOBAL_EXTERN_DIR}/openal/lib" NO_DEFAULT_PATH)
|
|
ENDIF()
|
|
IF(NOT OPENAL_LIBRARIES)
|
|
FIND_LIBRARY(OPENAL_LIBRARIES NAMES openal${COMPILE_POSTFIX})
|
|
ENDIF()
|
|
ENDIF()
|
|
|
|
# Copy the results to the output variables.
|
|
IF(OPENAL_INCLUDE_DIR AND OPENAL_LIBRARIES)
|
|
SET(OPENAL_FOUND TRUE CACHE INTERNAL "")
|
|
ELSE()
|
|
SET(OPENAL_FOUND FALSE CACHE INTERNAL "")
|
|
ENDIF()
|
|
|
|
# Report the results.
|
|
IF(NOT OPENAL_FOUND)
|
|
SET(OPENAL_MESSAGE "OPENAL was not found. Make sure OPENAL_INCLUDE_DIR AND OPENAL_LIBRARIES are set correctly.")
|
|
IF(OPENAL_FIND_REQUIRED)
|
|
MESSAGE(FATAL_ERROR "${OPENAL_MESSAGE}")
|
|
ELSEIF(NOT OPENAL_FIND_QUIETLY)
|
|
MESSAGE(STATUS "${OPENAL_MESSAGE}")
|
|
ENDIF()
|
|
ELSEIF(NOT OPENAL_FIND_QUIETLY)
|
|
MESSAGE(STATUS "Looking for OPENAL - found")
|
|
ENDIF()
|
|
|
|
MESSAGE(STATUS "OPENAL_INCLUDE_DIR:${OPENAL_INCLUDE_DIR}")
|
|
MESSAGE(STATUS "OPENAL_LIBRARIES:${OPENAL_LIBRARIES}")
|
|
|