CMakeLists.txt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}")
  9. ly_add_target(
  10. NAME ${gem_name}.Static STATIC
  11. NAMESPACE Gem
  12. FILES_CMAKE
  13. localuser_files.cmake
  14. ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  15. INCLUDE_DIRECTORIES
  16. PRIVATE
  17. Source
  18. PUBLIC
  19. Include
  20. BUILD_DEPENDENCIES
  21. PUBLIC
  22. AZ::AzCore
  23. AZ::AzFramework
  24. )
  25. ly_add_target(
  26. NAME ${gem_name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
  27. NAMESPACE Gem
  28. FILES_CMAKE
  29. localuser_shared_files.cmake
  30. INCLUDE_DIRECTORIES
  31. PRIVATE
  32. Source
  33. PUBLIC
  34. Include
  35. BUILD_DEPENDENCIES
  36. PRIVATE
  37. Gem::${gem_name}.Static
  38. )
  39. # Inject the gem name into the Module source file
  40. ly_add_source_properties(
  41. SOURCES
  42. Source/LocalUserModule.cpp
  43. PROPERTY COMPILE_DEFINITIONS
  44. VALUES
  45. O3DE_GEM_NAME=${gem_name}
  46. O3DE_GEM_VERSION=${gem_version})
  47. # by default, load the above "Gem::${gem_name}" module in client applications
  48. ly_create_alias(NAME ${gem_name}.Clients NAMESPACE Gem TARGETS Gem::${gem_name})
  49. ################################################################################
  50. # Tests
  51. ################################################################################
  52. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
  53. ly_add_target(
  54. NAME ${gem_name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  55. NAMESPACE Gem
  56. FILES_CMAKE
  57. localuser_tests_files.cmake
  58. INCLUDE_DIRECTORIES
  59. PRIVATE
  60. Tests
  61. Source
  62. BUILD_DEPENDENCIES
  63. PRIVATE
  64. AZ::AzTest
  65. Gem::${gem_name}.Static
  66. )
  67. ly_add_googletest(
  68. NAME Gem::${gem_name}.Tests
  69. LABELS REQUIRES_tiaf
  70. )
  71. endif()