CMakeLists.txt 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_SHADER_MANAGEMENT_CONSOLE_APPLICATION_SUPPORTED
  13. if(NOT PAL_TRAIT_ATOM_SHADER_MANAGEMENT_CONSOLE_APPLICATION_SUPPORTED)
  14. return()
  15. endif()
  16. ly_add_target(
  17. NAME ShaderManagementConsole APPLICATION
  18. NAMESPACE Gem
  19. AUTOMOC
  20. AUTORCC
  21. FILES_CMAKE
  22. shadermanagementconsole_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::AtomToolsFramework.Static
  36. Gem::AtomToolsFramework.Editor
  37. Gem::AtomShader.Static
  38. RUNTIME_DEPENDENCIES
  39. Gem::AtomToolsFramework.Editor
  40. )
  41. if(PAL_TRAIT_BUILD_EXTERNAL_CRASH_HANDLER_SUPPORTED)
  42. ly_target_link_libraries(ShaderManagementConsole PRIVATE AZ::ToolsCrashHandler)
  43. endif()
  44. ly_set_gem_variant_to_load(TARGETS ShaderManagementConsole VARIANTS Tools)
  45. # Add a 'builders' alias to allow the ShaderManagementConsole root gem path to be added to the generated
  46. # cmake_dependencies.<project>.assetprocessor.setreg to allow the asset scan folder for it to be added
  47. ly_create_alias(NAME ShaderManagementConsole.Builders NAMESPACE Gem)
  48. # Add build dependency to Editor for the ShaderManagementConsole application since
  49. # Editor opens up the ShaderManagementConsole
  50. ly_add_dependencies(Editor Gem::ShaderManagementConsole)
  51. # Inject the project path into the ShaderManagementConsole VS debugger command arguments if the build system being invoked
  52. # in a project centric view
  53. if(NOT PROJECT_NAME STREQUAL "O3DE")
  54. set_property(TARGET ShaderManagementConsole APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${CMAKE_SOURCE_DIR}\"")
  55. endif()
  56. # Adds the ShaderManagementConsole target as a C preprocessor define so that it can be used as a Settings Registry
  57. # specialization in order to look up the generated .setreg which contains the dependencies
  58. # specified for the target.
  59. if(TARGET ShaderManagementConsole)
  60. set_source_files_properties(
  61. Source/ShaderManagementConsoleApplication.cpp
  62. PROPERTIES
  63. COMPILE_DEFINITIONS
  64. LY_CMAKE_TARGET="ShaderManagementConsole"
  65. )
  66. else()
  67. message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to ShaderManagementConsole as the target doesn't exist anymore."
  68. " Perhaps it has been renamed")
  69. endif()