FindPhysX5_ios.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. set(MY_NAME "PhysX5")
  9. set(TARGET_WITH_NAMESPACE "3rdParty::${MY_NAME}")
  10. if (TARGET ${TARGET_WITH_NAMESPACE})
  11. return()
  12. endif()
  13. set(_PACKAGE_DIR ${CMAKE_CURRENT_LIST_DIR}/PhysX/physx)
  14. set(${MY_NAME}_INCLUDE_DIR
  15. ${_PACKAGE_DIR}/include
  16. ${_PACKAGE_DIR}/include/foundation
  17. ${_PACKAGE_DIR}/include/geometry
  18. )
  19. set(${MY_NAME}_COMPILE_DEFINITIONS PX_PHYSX_STATIC_LIB)
  20. # LY_PHYSX_PROFILE_USE_CHECKED_LIBS allows to override what PhysX configuration to use on O3DE profile.
  21. set(LY_PHYSX_PROFILE_USE_CHECKED_LIBS OFF CACHE BOOL "When ON it uses PhysX SDK checked libraries on O3DE profile configuration")
  22. if(LY_PHYSX_PROFILE_USE_CHECKED_LIBS)
  23. set(PHYSX_PROFILE_CONFIG "checked")
  24. else()
  25. set(PHYSX_PROFILE_CONFIG "profile")
  26. endif()
  27. set(PATH_TO_LIBS ${_PACKAGE_DIR}/bin/static/$<IF:$<CONFIG:profile>,${PHYSX_PROFILE_CONFIG},$<CONFIG>>)
  28. set(${MY_NAME}_LIBRARIES
  29. ${PATH_TO_LIBS}/libPhysXCharacterKinematic_static_64.a
  30. ${PATH_TO_LIBS}/libPhysXVehicle_static_64.a
  31. ${PATH_TO_LIBS}/libPhysXExtensions_static_64.a
  32. ${PATH_TO_LIBS}/libPhysXPvdSDK_static_64.a
  33. ${PATH_TO_LIBS}/libPhysX_static_64.a
  34. ${PATH_TO_LIBS}/libPhysXCooking_static_64.a
  35. ${PATH_TO_LIBS}/libPhysXFoundation_static_64.a
  36. ${PATH_TO_LIBS}/libPhysXCommon_static_64.a
  37. )
  38. add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
  39. ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${MY_NAME}_INCLUDE_DIR})
  40. target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${${MY_NAME}_LIBRARIES})
  41. target_compile_definitions(${TARGET_WITH_NAMESPACE} INTERFACE ${${MY_NAME}_COMPILE_DEFINITIONS})
  42. # Frameworks do not need to get added as runtime dependencies
  43. # since they are handled by XCode directly. Frameworks will
  44. # be copied into the app when constructed by XCode.
  45. set(${MY_NAME}_FOUND True)