#------------------------------------------------------------------- # This file is part of the CMake build system for OGRE # (Object-oriented Graphics Rendering Engine) # For the latest info, see http://www.ogre3d.org/ # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- # - Try to find cAudio # Once done, this will define # # cAudio_FOUND - system has cAudio # cAudio_INCLUDE_DIRS - the cAudio include directories # cAudio_LIBRARIES - link these to use cAudio include(FindPkgMacros) findpkg_begin(cAudio) # construct search paths set(cAudio_PREFIX_PATH ${SCOLDEPS_SOURCE_DIR}/cAudio/cAudio ${SCOLDEPS_LIB_DIRECTORY}) create_search_paths(cAudio) # redo search if prefix path changed clear_if_changed(cAudio_PREFIX_PATH cAudio_LIBRARY_FWK cAudio_LIBRARY_REL cAudio_LIBRARY_DBG cAudio_INCLUDE_DIR ) set(cAudio_LIBRARY_NAMES cAudio) get_debug_names(cAudio_LIBRARY_NAMES) use_pkgconfig(cAudio_PKGC cAudio) findpkg_framework(cAudio) # Search for dependencies find_package(Ogg) find_package(Vorbis) find_package(OpenAL) # Search for library files find_path(cAudio_INCLUDE_DIR NAMES cAudio.h HINTS ${cAudio_INC_SEARCH_PATH} ${cAudio_PKGC_INCLUDE_DIRS} PATH_SUFFIXES cAudio) find_library(cAudio_LIBRARY_REL NAMES ${cAudio_LIBRARY_NAMES} HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) find_library(cAudio_LIBRARY_DBG NAMES ${cAudio_LIBRARY_NAMES_DBG} HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) make_library_set(cAudio_LIBRARY) #find_library(cAudio_LIBRARY_EAX_REL NAMES EAXLegacyPreset HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) #find_library(cAudio_LIBRARY_EAX_DBG NAMES EAXLegacyPreset_d HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) #make_library_set(cAudio_LIBRARY_EAX) find_library(cAudio_LIBRARY_MP3_REL NAMES cAp_mp3Decoder HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) find_library(cAudio_LIBRARY_MP3_DBG NAMES cAp_mp3Decoder_d cAp_mp3Decoder HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) make_library_set(cAudio_LIBRARY_MP3) find_library(cAudio_LIBRARY_OPENAL_REL NAMES OpenAL32 openal HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel) find_library(cAudio_LIBRARY_OPENAL_DBG NAMES OpenAL32d OpenAL32 openald openal HINTS ${cAudio_LIB_SEARCH_PATH} ${cAudio_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug) make_library_set(cAudio_LIBRARY_OPENAL) SET (CAUDIO_PLATFORM_LIBRARY "") if (ANDROID) SET (CAUDIO_PLATFORM_LIBRARY OpenSLES) elseif (WIN32) SET (CAUDIO_PLATFORM_LIBRARY Winmm.lib) endif () add_parent_dir(cAudio_INCLUDE_DIRS cAudio_INCLUDE_DIR) findpkg_finish(cAudio) # Set global variables for cAudio SET(cAudio_LIBRARIES ${cAudio_LIBRARY} #${cAudio_LIBRARY_EAX} ${cAudio_LIBRARY_MP3} ${Vorbis_LIBRARIES} ${Ogg_LIBRARIES} ${cAudio_LIBRARY_OPENAL} ${CAUDIO_PLATFORM_LIBRARY} CACHE STRING "cAudio libraries files" FORCE) SET(cAudio_INCLUDE_DIRS ${cAudio_INCLUDE_DIRS} ${Ogg_INCLUDE_DIRS} ${Vorbis_INCLUDE_DIRS} CACHE STRING "cAudio libraries files" FORCE) # Show variables in GUI SET(cAudio_LIBRARY ${cAudio_LIBRARY} CACHE INTERNAL "") SET(cAudio_INCLUDE_DIR ${cAudio_INCLUDE_DIR} CACHE INTERNAL "") SET(Ogg_LIBRARIES ${Ogg_LIBRARIES} CACHE INTERNAL "") SET(Vorbis_LIBRARIES ${Vorbis_LIBRARIES} CACHE INTERNAL "") SET(Ogg_INCLUDE_DIRS ${Ogg_INCLUDE_DIRS} CACHE INTERNAL "") SET(Vorbis_INCLUDE_DIRS ${Vorbis_INCLUDE_DIRS} CACHE INTERNAL "") IF(cAudio_INCLUDE_DIR AND cAudio_LIBRARY AND Ogg_LIBRARIES AND Vorbis_LIBRARIES AND cAudio_LIBRARY_OPENAL) SET(cAudio_FOUND TRUE) ELSE () SET(cAudio_FOUND FALSE) ENDIF() # log find result IF(cAudio_FOUND) IF(NOT cAudio_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${cAudio_LIBRARIES}") MESSAGE(STATUS " includes: ${cAudio_INCLUDE_DIRS}") ENDIF() ELSE(cAudio_FOUND) IF(NOT cAudio_LIBRARIES) MESSAGE(STATUS " cAudio library or one of it dependencies could not be found.") ENDIF() IF(NOT cAudio_INCLUDE_DIRS) MESSAGE(STATUS " cAudio include files could not be found.") ENDIF() IF(NOT Ogg_FOUND) MESSAGE(STATUS " cAudio dependency could not be found: lib Ogg") ENDIF() IF(NOT Vorbis_FOUND) MESSAGE(STATUS " cAudio dependency could not be found: lib Vorbis") ENDIF() IF(NOT OPENAL_FOUND) MESSAGE(STATUS " cAudio dependency could not be found: lib OpenAL") ENDIF() ENDIF(cAudio_FOUND)