diff --git a/Gems/AudioEngineWwise/gem.json b/Gems/AudioEngineWwise/gem.json index dc5f968bc7..699ed8419a 100644 --- a/Gems/AudioEngineWwise/gem.json +++ b/Gems/AudioEngineWwise/gem.json @@ -8,5 +8,5 @@ "canonical_tags": ["Gem"], "user_tags": ["Audio", "Utility", "Tools"], "icon_path": "preview.png", - "requirements": "Users will need to download WWise from the AudioKinetic web site: https://www.audiokinetic.com/download/" + "requirements": "Users will need to download Wwise from the Audiokinetic web site: https://www.audiokinetic.com/download/" } diff --git a/README.md b/README.md index 6b88097739..c129fffb6c 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,13 @@ git clone https://github.com/o3de/o3de.git #### Optional -* Wwise - 2021.1.1.7601 minimum: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) +* Wwise version 2021.1.1.7601 minimum: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) * Note: This requires registration and installation of a client application to download - * Make sure to select the SDK(C++) component during installation of Wwise - * You will also need to set an environment variable: `set LY_WWISE_INSTALL_PATH=` - * For example: `set LY_WWISE_INSTALL_PATH="C:\Program Files (x86)\Audiokinetic\Wwise 2021.1.1.7601"` + * Note: It is generally okay to use a more recent version of Wwise, but some SDK updates will require code changes + * Make sure to select the `SDK(C++)` component during installation of Wwise + * CMake can find the Wwise install location in two ways: + * The `LY_WWISE_INSTALL_PATH` CMake cache variable -- this is checked first + * The `WWISEROOT` environment variable which is set when installing Wwise SDK ### Quick Start Build Steps @@ -54,8 +56,7 @@ git clone https://github.com/o3de/o3de.git 1. Install the following redistributables to the following: - Visual Studio and VC++ redistributable can be installed to any location - CMake can be installed to any location, as long as it's available in the system path - - (Optional) Wwise can be installed anywhere, but you will need to set an environment variable for CMake to detect it: `set LY_WWISE_INSTALL_PATH=` - + 1. Configure the source into a solution using this command line, replacing and <3rdParty cache path> to a path you've created: ``` cmake -B -S -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty cache path> -DLY_UNITY_BUILD=ON -DLY_PROJECTS=AutomatedTesting diff --git a/cmake/3rdParty/FindWwise.cmake b/cmake/3rdParty/FindWwise.cmake index 8cd6db31dd..4cb95da319 100644 --- a/cmake/3rdParty/FindWwise.cmake +++ b/cmake/3rdParty/FindWwise.cmake @@ -6,25 +6,16 @@ # # -# The current supported version of Wwise -set(WWISE_VERSION 2021.1.1.7601) - # Wwise Install Path -# Initialize to the default 3rdParty path -set(LY_WWISE_INSTALL_PATH "" CACHE PATH "Path to Wwise version ${WWISE_VERSION} installation.") +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}) - string(FIND ${sdk_path} ${WWISE_VERSION} index) - if(NOT index EQUAL -1) - set(${is_valid} TRUE PARENT_SCOPE) - else() - # The install path doesn't contain the WWISE_VERSION string. - # The path could still be correct, but it would require parsing the AkWwiseSDKVersion.h to verify. - endif() + set(${is_valid} TRUE PARENT_SCOPE) endif() endif() endfunction() @@ -32,19 +23,17 @@ endfunction() # Paths that will be checked, in order: # - CMake cache variable # - WWISEROOT Environment Variable -# - Standard 3rdParty path set(WWISE_SDK_PATHS "${LY_WWISE_INSTALL_PATH}" "$ENV{WWISEROOT}" - "${LY_3RDPARTY_PATH}/Wwise/${WWISE_VERSION}" ) set(found_sdk FALSE) -foreach(test_path ${WWISE_SDK_PATHS}) - is_valid_sdk(${test_path} found_sdk) +foreach(candidate_path ${WWISE_SDK_PATHS}) + is_valid_sdk(${candidate_path} found_sdk) if(found_sdk) - # Update the Wwise Install Path cache variable - set(LY_WWISE_INSTALL_PATH "${test_path}") + # Update the Wwise Install Path variable internally + set(LY_WWISE_INSTALL_PATH "${candidate_path}") break() endif() endforeach() @@ -112,15 +101,14 @@ set(WWISE_COMPILE_DEFINITIONS ) -# The default install path might look different than the standard 3rdParty format (${LY_3RDPARTY_PATH}//). # Use these to get the parent path and folder name before adding the external 3p target. -get_filename_component(WWISE_3P_ROOT ${LY_WWISE_INSTALL_PATH} DIRECTORY) +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_3P_ROOT}" + 3RDPARTY_ROOT_DIRECTORY "${WWISE_INSTALL_ROOT}" INCLUDE_DIRECTORIES SDK/include COMPILE_DEFINITIONS ${WWISE_COMPILE_DEFINITIONS} )