CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. # Note we do not use if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) on this file.
  8. # This is because that flag is used to determine if the tests themselves should be built or not
  9. # But this is how you would build your own tests, and must be included in the installer, even if
  10. # we don't include the tests in the installer.
  11. # when compiling from source, use the 3rdParty/Find***.cmake files
  12. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty)
  13. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
  14. o3de_pal_dir(pal_aztest_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER})
  15. if (PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED)
  16. ly_add_target(
  17. NAME AzTest STATIC
  18. NAMESPACE AZ
  19. FILES_CMAKE
  20. AzTest/aztest_files.cmake
  21. ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
  22. INCLUDE_DIRECTORIES
  23. PUBLIC
  24. .
  25. ${pal_aztest_dir}
  26. BUILD_DEPENDENCIES
  27. PUBLIC
  28. 3rdParty::googletest::GMock # This dependency is what causes the find files to run.
  29. 3rdParty::googletest::GTest
  30. 3rdParty::GoogleBenchmark
  31. AZ::AzCore
  32. PLATFORM_INCLUDE_FILES
  33. ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
  34. )
  35. endif()