Skip to content

Commit

Permalink
Merge pull request #1598 from dpogue/physx-find-order
Browse files Browse the repository at this point in the history
FindPhysX should search specific lib names first
  • Loading branch information
dpogue authored Jul 9, 2024
2 parents 01d0704 + 9ad11a8 commit f405924
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/FindPhysX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ elseif(NOT VCPKG_TOOLCHAIN)
set(_PHYSX_RELEASE_PATHS ${CMAKE_PREFIX_PATH})
endif()

if(VCPKG_TOOLCHAIN)
set(_PHYSX_SKIP_SYSTEM_PATHS NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
endif()

find_path(PHYSX_INCLUDE_DIR NAMES PxPhysicsAPI.h
PATHS ${_PHYSX_PREFIX}
PATH_SUFFIXES include/physx include
NO_CMAKE_PATH
${_PHYSX_SKIP_SYSTEM_PATHS}
)
mark_as_advanced(PHYSX_INCLUDE_DIR)

Expand All @@ -154,6 +159,7 @@ if(PHYSX_INCLUDE_DIR)
PATHS ${_PHYSX_PREFIX}
PATH_SUFFIXES include/physx include
NO_CMAKE_PATHS
${_PHYSX_SKIP_SYSTEM_PATHS}
)
mark_as_advanced(PHYSX_FOUNDATION_INCLUDE_DIR)
else()
Expand All @@ -173,12 +179,14 @@ macro(_find_physx_library SUFFIX)
PATHS ${_PHYSX_RELEASE_PATHS}
PATH_SUFFIXES lib
NO_CMAKE_PATH
${_PHYSX_SKIP_SYSTEM_PATHS}
)
find_library(${VAR_NAME}_LIBRARY_DEBUG
NAMES ${_${VAR_NAME}_LIBRARY_NAMES}
PATHS ${_PHYSX_DEBUG_PATHS}
PATH_SUFFIXES lib
NO_CMAKE_PATH
${_PHYSX_SKIP_SYSTEM_PATHS}
)
select_library_configurations(${VAR_NAME})

Expand Down

0 comments on commit f405924

Please sign in to comment.