CMakeLists.txt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.Static STATIC
  10. NAMESPACE AZ
  11. FILES_CMAKE
  12. asset_builder_static_files.cmake
  13. INCLUDE_DIRECTORIES
  14. PUBLIC
  15. .
  16. BUILD_DEPENDENCIES
  17. PUBLIC
  18. AZ::AzCore
  19. AZ::AzFramework
  20. AZ::AzToolsFramework
  21. AZ::AssetBuilderSDK
  22. )
  23. ly_add_target(
  24. NAME AssetBuilder EXECUTABLE
  25. NAMESPACE AZ
  26. FILES_CMAKE
  27. asset_builder_files.cmake
  28. Platform/${PAL_PLATFORM_NAME}/asset_builder_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  29. INCLUDE_DIRECTORIES
  30. PUBLIC
  31. .
  32. BUILD_DEPENDENCIES
  33. PRIVATE
  34. AssetBuilder.Static
  35. 3rdParty::Qt::Core
  36. 3rdParty::Qt::Gui
  37. 3rdParty::Qt::Network
  38. AZ::AzCore
  39. AZ::AssetBuilderSDK
  40. AZ::AzToolsFramework
  41. )
  42. if(LY_DEFAULT_PROJECT_PATH)
  43. set_property(TARGET AssetBuilder APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"")
  44. endif()
  45. # Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define
  46. get_property(asset_builders GLOBAL PROPERTY LY_ASSET_BUILDERS)
  47. string (REPLACE ";" "," asset_builders "${asset_builders}")
  48. ly_add_source_properties(
  49. SOURCES AssetBuilderComponent.cpp
  50. PROPERTY COMPILE_DEFINITIONS
  51. VALUES LY_ASSET_BUILDERS="${asset_builders}"
  52. )
  53. if(TARGET AssetBuilder)
  54. ly_set_gem_variant_to_load(TARGETS AssetBuilder VARIANTS Builders)
  55. # Adds the AssetBuilder 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 AssetBuilder in the <Project>/Gem/Code/CMakeLists via ly_add_project_dependencies
  58. ly_add_source_properties(
  59. SOURCES AssetBuilderApplication.cpp
  60. PROPERTY COMPILE_DEFINITIONS
  61. VALUES LY_CMAKE_TARGET="AssetBuilder"
  62. )
  63. else()
  64. message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to AssetBuilder as the target doesn't exist anymore."
  65. " Perhaps it has been renamed")
  66. endif()