7b7adb8573
* Updates the Wwise SDK detection in CMake Parses AkWwiseSDKVersion.h to obtain the version instead of requiring an exact version to be installed. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Updates readme.md information about Wwise Rewrite some of the setup info about Wwise, mention the two ways in which Wwise can be found via CMake and that users can install later versions than the one specified. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Remove unnecessary parts of Wwise version detect Don't need to parse the file contents, it was only being used to print a message to CMake. Simplify the validation to just checking that the SDK version header exists. Maybe in the future we can reinstate better version checking to make sure the version falls within a range. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Updates capitalization of Audiokinetic name Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
117 lines
2.7 KiB
CMake
117 lines
2.7 KiB
CMake
#
|
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
#
|
|
#
|
|
|
|
# Wwise Install Path
|
|
set(LY_WWISE_INSTALL_PATH "" CACHE PATH "Path to Wwise installation.")
|
|
|
|
# Check for a known file in the SDK path to verify the path
|
|
function(is_valid_sdk sdk_path is_valid)
|
|
set(${is_valid} FALSE PARENT_SCOPE)
|
|
if(EXISTS ${sdk_path})
|
|
set(sdk_version_file ${sdk_path}/SDK/include/AK/AkWwiseSDKVersion.h)
|
|
if(EXISTS ${sdk_version_file})
|
|
set(${is_valid} TRUE PARENT_SCOPE)
|
|
endif()
|
|
endif()
|
|
endfunction()
|
|
|
|
# Paths that will be checked, in order:
|
|
# - CMake cache variable
|
|
# - WWISEROOT Environment Variable
|
|
set(WWISE_SDK_PATHS
|
|
"${LY_WWISE_INSTALL_PATH}"
|
|
"$ENV{WWISEROOT}"
|
|
)
|
|
|
|
set(found_sdk FALSE)
|
|
foreach(candidate_path ${WWISE_SDK_PATHS})
|
|
is_valid_sdk(${candidate_path} found_sdk)
|
|
if(found_sdk)
|
|
# Update the Wwise Install Path variable internally
|
|
set(LY_WWISE_INSTALL_PATH "${candidate_path}")
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
|
|
if(NOT found_sdk)
|
|
# If we don't find a path that appears to be a valid Wwise install, we can bail here.
|
|
# No 3rdParty::Wwise target will exist, so that can be checked elsewhere.
|
|
return()
|
|
endif()
|
|
|
|
message(STATUS "Using Wwise SDK at ${LY_WWISE_INSTALL_PATH}")
|
|
|
|
set(WWISE_COMMON_LIB_NAMES
|
|
# Core AK
|
|
AkMemoryMgr
|
|
AkMusicEngine
|
|
AkSoundEngine
|
|
AkStreamMgr
|
|
AkSpatialAudio
|
|
|
|
# AK Effects
|
|
AkCompressorFX
|
|
AkDelayFX
|
|
AkMatrixReverbFX
|
|
AkMeterFX
|
|
AkExpanderFX
|
|
AkParametricEQFX
|
|
AkGainFX
|
|
AkPeakLimiterFX
|
|
AkRoomVerbFX
|
|
AkGuitarDistortionFX
|
|
AkStereoDelayFX
|
|
AkPitchShifterFX
|
|
AkTimeStretchFX
|
|
AkFlangerFX
|
|
AkTremoloFX
|
|
AkHarmonizerFX
|
|
AkRecorderFX
|
|
|
|
# AK Sources
|
|
AkSilenceSource
|
|
AkSineSource
|
|
AkToneSource
|
|
AkAudioInputSource
|
|
AkSynthOneSource
|
|
)
|
|
|
|
set(WWISE_CODEC_LIB_NAMES
|
|
# AK Codecs
|
|
AkVorbisDecoder
|
|
AkOpusDecoder
|
|
)
|
|
|
|
set(WWISE_NON_RELEASE_LIB_NAMES
|
|
# For remote profiling
|
|
CommunicationCentral
|
|
)
|
|
|
|
set(WWISE_ADDITIONAL_LIB_NAMES
|
|
# Additional Libraries
|
|
)
|
|
|
|
set(WWISE_COMPILE_DEFINITIONS
|
|
$<IF:$<CONFIG:Release>,AK_OPTIMIZED,>
|
|
)
|
|
|
|
|
|
# Use these to get the parent path and folder name before adding the external 3p target.
|
|
get_filename_component(WWISE_INSTALL_ROOT ${LY_WWISE_INSTALL_PATH} DIRECTORY)
|
|
get_filename_component(WWISE_FOLDER ${LY_WWISE_INSTALL_PATH} NAME)
|
|
|
|
ly_add_external_target(
|
|
NAME Wwise
|
|
VERSION "${WWISE_FOLDER}"
|
|
3RDPARTY_ROOT_DIRECTORY "${WWISE_INSTALL_ROOT}"
|
|
INCLUDE_DIRECTORIES SDK/include
|
|
COMPILE_DEFINITIONS ${WWISE_COMPILE_DEFINITIONS}
|
|
)
|
|
|
|
set(Wwise_FOUND TRUE)
|