CMakeLists.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER})
  9. include(${pal_dir}/LauncherUnified_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
  10. ly_add_target(
  11. NAME Launcher.Static STATIC
  12. NAMESPACE AZ
  13. FILES_CMAKE
  14. launcher_files.cmake
  15. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  16. PLATFORM_INCLUDE_FILES
  17. ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  18. INCLUDE_DIRECTORIES
  19. PRIVATE
  20. .
  21. ${pal_dir}
  22. BUILD_DEPENDENCIES
  23. PUBLIC
  24. AZ::AzCore
  25. AZ::AzGameFramework
  26. Legacy::CryCommon
  27. )
  28. ly_add_target(
  29. NAME Launcher.Game.Static STATIC
  30. NAMESPACE AZ
  31. FILES_CMAKE
  32. launcher_game_files.cmake
  33. ${pal_dir}/launcher_game_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  34. INCLUDE_DIRECTORIES
  35. PRIVATE
  36. .
  37. BUILD_DEPENDENCIES
  38. PRIVATE
  39. AZ::AzCore
  40. AZ::AzGameFramework
  41. Legacy::CryCommon
  42. )
  43. if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
  44. ly_add_target(
  45. NAME Launcher.Server.Static STATIC
  46. NAMESPACE AZ
  47. FILES_CMAKE
  48. launcher_server_files.cmake
  49. INCLUDE_DIRECTORIES
  50. PRIVATE
  51. .
  52. BUILD_DEPENDENCIES
  53. PRIVATE
  54. AZ::AzCore
  55. AZ::AzGameFramework
  56. Legacy::CryCommon
  57. )
  58. endif()
  59. if(PAL_TRAIT_BUILD_UNIFIED_SUPPORTED)
  60. ly_add_target(
  61. NAME Launcher.Unified.Static STATIC
  62. NAMESPACE AZ
  63. FILES_CMAKE
  64. launcher_unified_files.cmake
  65. INCLUDE_DIRECTORIES
  66. PRIVATE
  67. .
  68. BUILD_DEPENDENCIES
  69. PRIVATE
  70. AZ::AzCore
  71. AZ::AzGameFramework
  72. Legacy::CryCommon
  73. )
  74. endif()
  75. include(${CMAKE_CURRENT_LIST_DIR}/launcher_generator.cmake)
  76. ################################################################################
  77. # Tests
  78. ################################################################################
  79. if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
  80. ly_add_target(
  81. NAME Launcher.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
  82. NAMESPACE AZ
  83. FILES_CMAKE
  84. launcher_test_files.cmake
  85. COMPILE_DEFINITIONS
  86. PRIVATE
  87. LY_CMAKE_TARGET="Launcher_Tests"
  88. INCLUDE_DIRECTORIES
  89. PRIVATE
  90. .
  91. ${pal_dir}
  92. BUILD_DEPENDENCIES
  93. PRIVATE
  94. AZ::AzTest
  95. AZ::Launcher.Static
  96. )
  97. ly_add_googletest(
  98. NAME AZ::Launcher.Tests
  99. LABELS REQUIRES_tiaf
  100. )
  101. endif()
  102. ################################################################################
  103. # Install
  104. ################################################################################
  105. ly_install_files(
  106. FILES
  107. launcher_generator.cmake
  108. launcher_project_files.cmake
  109. LauncherProject.cpp
  110. StaticModules.in
  111. DESTINATION LauncherGenerator
  112. )
  113. ly_install_directory(
  114. DIRECTORIES
  115. Platform/${PAL_PLATFORM_NAME}
  116. Platform/Common
  117. DESTINATION LauncherGenerator/Platform
  118. VERBATIM
  119. )
  120. ly_install_files(
  121. FILES FindLauncherGenerator.cmake
  122. DESTINATION cmake
  123. )