CMakeLists.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. if(NOT COMMAND o3de_gem_setup)
  9. # Backwards compatibility for older engines
  10. macro(o3de_gem_setup default_gem_name)
  11. # Query the gem name from the gem.json file if possible
  12. # otherwise fallback to using the default gem name argument
  13. o3de_find_ancestor_gem_root(gem_path gem_name "${CMAKE_CURRENT_SOURCE_DIR}")
  14. if (NOT gem_name)
  15. set(gem_name "${default_gem_name}")
  16. endif()
  17. # Fallback to using the current source CMakeLists.txt directory as the gem root path
  18. if (NOT gem_path)
  19. set(gem_path ${CMAKE_CURRENT_SOURCE_DIR})
  20. endif()
  21. set(gem_json ${gem_path}/gem.json)
  22. # Read the version field from the gem.json
  23. set(gem_version, "0.0.0")
  24. o3de_read_json_key(gem_version ${gem_json} "version")
  25. o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path)
  26. o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  27. endmacro()
  28. endif()
  29. o3de_gem_setup("AudioEngineWwise")
  30. if(TARGET AudioEngineWwise)
  31. # For backwards compatibility with engines that include AudioEngineWwise
  32. # use Wwise for the targets if AudioEngineWwise is already defined
  33. set(gem_name "Wwise")
  34. endif()
  35. add_subdirectory(Code)