2
0

CMakeLists.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. ly_add_target(
  9. NAME AssetBuilder EXECUTABLE
  10. NAMESPACE AZ
  11. FILES_CMAKE
  12. asset_builder_files.cmake
  13. Platform/${PAL_PLATFORM_NAME}/asset_builder_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  14. INCLUDE_DIRECTORIES
  15. PUBLIC
  16. .
  17. BUILD_DEPENDENCIES
  18. PRIVATE
  19. 3rdParty::Qt::Core
  20. 3rdParty::Qt::Gui
  21. 3rdParty::Qt::Network
  22. AZ::AzCore
  23. AZ::AssetBuilderSDK
  24. AZ::AzToolsFramework
  25. )
  26. if(LY_DEFAULT_PROJECT_PATH)
  27. set_property(TARGET AssetBuilder APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"")
  28. endif()
  29. # Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define
  30. get_property(asset_builders GLOBAL PROPERTY LY_ASSET_BUILDERS)
  31. string (REPLACE ";" "," asset_builders "${asset_builders}")
  32. ly_add_source_properties(
  33. SOURCES AssetBuilderComponent.cpp
  34. PROPERTY COMPILE_DEFINITIONS
  35. VALUES LY_ASSET_BUILDERS="${asset_builders}"
  36. )
  37. if(TARGET AssetBuilder)
  38. ly_set_gem_variant_to_load(TARGETS AssetBuilder VARIANTS Builders)
  39. # Adds the AssetBuilder target as a C preprocessor define so that it can be used as a Settings Registry
  40. # specialization in order to look up the generated .setreg which contains the dependencies
  41. # specified for the AssetBuilder in the <Project>/Gem/Code/CMakeLists via ly_add_project_dependencies
  42. ly_add_source_properties(
  43. SOURCES AssetBuilderApplication.cpp
  44. PROPERTY COMPILE_DEFINITIONS
  45. VALUES LY_CMAKE_TARGET="AssetBuilder"
  46. )
  47. else()
  48. message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to AssetBuilder as the target doesn't exist anymore."
  49. " Perhaps it has been renamed")
  50. endif()