CMakeLists.txt 3.9 KB

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