CMakeLists.txt 971 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # 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.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #
  6. #
  7. if(NOT PROJECT_NAME)
  8. cmake_minimum_required(VERSION 3.19)
  9. project(AtomSampleViewer
  10. LANGUAGES C CXX
  11. VERSION 1.0.0.0
  12. )
  13. include(EngineFinder.cmake OPTIONAL)
  14. find_package(o3de REQUIRED)
  15. o3de_initialize()
  16. else()
  17. # Add the project_name to global LY_PROJECTS_TARGET_NAME property
  18. file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json)
  19. string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
  20. if(json_error)
  21. message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'")
  22. endif()
  23. set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name})
  24. add_subdirectory(Gem)
  25. add_subdirectory(Standalone)
  26. endif()