Add physx library

This commit is contained in:
bailehuni 2024-07-29 23:51:46 +01:00
parent 97dcc0c75e
commit 9efc001e26
3 changed files with 30 additions and 5 deletions

View File

@ -7,6 +7,8 @@ option(ENGINE_BUILD_TEST "Compile the test program" ON)
if (MSVC)
option(ENGINE_HOT_RELOAD "Enable VS hot reload" OFF)
endif()
option(ENGINE_PHYSX_INCLUDE_DIR "Path to the PhysX SDK include directory" "")
option(ENGINE_PHYSX_LIBRARY_DIR "PhysX library location (often different per build configuration)" "")
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
@ -219,3 +221,14 @@ target_link_libraries(${PROJECT_NAME} PUBLIC mikktspace)
# weldmesh
add_subdirectory(vendor/weldmesh)
target_link_libraries(${PROJECT_NAME} PUBLIC weldmesh)
# PhysX 5
target_include_directories(${PROJECT_NAME} PUBLIC ${ENGINE_PHYSX_INCLUDE_DIR})
target_link_directories(${PROJECT_NAME} PUBLIC ${ENGINE_PHYSX_LIBRARY_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC
PhysXCooking_64
PVDRuntime_64
PhysX_64
PhysXCommon_64
PhysXFoundation_64
)

View File

@ -30,7 +30,9 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ENGINETEST_BUILD_WIN32_APP": "OFF",
"ENGINE_HOT_RELOAD": "ON"
"ENGINE_HOT_RELOAD": "ON",
"ENGINE_PHYSX_LIBRARY_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/bin/win.x86_64.vc143.mt/checked",
"ENGINE_PHYSX_INCLUDE_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/include"
}
},
{
@ -41,7 +43,9 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"ENGINETEST_BUILD_WIN32_APP": "OFF",
"ENGINE_HOT_RELOAD": "ON"
"ENGINE_HOT_RELOAD": "ON",
"ENGINE_PHYSX_LIBRARY_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/bin/win.x86_64.vc143.mt/checked",
"ENGINE_PHYSX_INCLUDE_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/include"
}
},
{
@ -52,7 +56,9 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"ENGINETEST_BUILD_WIN32_APP": "ON",
"ENGINE_HOT_RELOAD": "OFF"
"ENGINE_HOT_RELOAD": "OFF",
"ENGINE_PHYSX_LIBRARY_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/bin/win.x86_64.vc143.mt/release",
"ENGINE_PHYSX_INCLUDE_DIR": "C:/Users/Bailey/source/repos/bailwillharr/PhysX-106.0-physx-5.4.1/physx/include"
}
}
]

View File

@ -63,3 +63,9 @@ add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
${ENGINE_SOURCE_DIR}/res/engine $<TARGET_FILE_DIR:enginetest>/res/engine)
# copy dlls
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:enginetest> $<TARGET_RUNTIME_DLLS:enginetest>
COMMAND_EXPAND_LISTS
)