CMakeLists.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 PAL_TRAIT_BUILD_HOST_TOOLS)
  9. return()
  10. endif()
  11. o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  12. include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_PASS_CANVAS_APPLICATION_SUPPORTED
  13. if(NOT PAL_TRAIT_ATOM_PASS_CANVAS_APPLICATION_SUPPORTED)
  14. return()
  15. endif()
  16. ly_add_target(
  17. NAME PassCanvas APPLICATION
  18. NAMESPACE Gem
  19. AUTOMOC
  20. AUTORCC
  21. FILES_CMAKE
  22. passcanvas_files.cmake
  23. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  24. PLATFORM_INCLUDE_FILES
  25. ${pal_source_dir}/tool_dependencies_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  26. INCLUDE_DIRECTORIES
  27. PRIVATE
  28. .
  29. Source
  30. ${pal_source_dir}
  31. PUBLIC
  32. Include
  33. BUILD_DEPENDENCIES
  34. PRIVATE
  35. Gem::CommonFeaturesAtom.Static
  36. Gem::AtomToolsFramework.Static
  37. RUNTIME_DEPENDENCIES
  38. Gem::AtomToolsFramework.Editor
  39. )
  40. if(PAL_TRAIT_BUILD_EXTERNAL_CRASH_HANDLER_SUPPORTED)
  41. ly_target_link_libraries(PassCanvas PRIVATE AZ::ToolsCrashHandler)
  42. endif()
  43. ly_set_gem_variant_to_load(TARGETS PassCanvas VARIANTS Tools)
  44. # Add a 'builders' alias to allow the PassCanvas root gem path to be added to the generated
  45. # cmake_dependencies.<project>.assetprocessor.setreg to allow the asset scan folder for it to be added
  46. ly_create_alias(NAME PassCanvas.Builders NAMESPACE Gem)
  47. # Add build dependency to Editor for the PassCanvas application since
  48. # Editor opens up the PassCanvas
  49. ly_add_dependencies(Editor Gem::PassCanvas)
  50. # Inject the project path into the PassCanvas VS debugger command arguments if the build system being invoked
  51. # in a project centric view
  52. if(NOT PROJECT_NAME STREQUAL "O3DE")
  53. set_property(TARGET PassCanvas APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${CMAKE_SOURCE_DIR}\"")
  54. endif()
  55. # Adds the PassCanvas target as a C preprocessor define so that it can be used as a Settings Registry
  56. # specialization in order to look up the generated .setreg which contains the dependencies
  57. # specified for the target.
  58. if(TARGET PassCanvas)
  59. set_source_files_properties(
  60. Source/PassCanvasApplication.cpp
  61. PROPERTIES
  62. COMPILE_DEFINITIONS
  63. LY_CMAKE_TARGET="PassCanvas"
  64. )
  65. else()
  66. message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to PassCanvas as the target doesn't exist anymore."
  67. " Perhaps it has been renamed")
  68. endif()