FindBullet

尋找 Bullet 物理引擎:

find_package(Bullet [...])

結果變數

該模組定義了以下變數:

Bullet_FOUND

在 3.3 版被加入.

Boolean indicating whether Bullet was found.

BULLET_INCLUDE_DIRS

Bullet 引入目錄。

BULLET_LIBRARIES

Libraries needed to link to Bullet. By default, all Bullet components (Dynamics, Collision, LinearMath, and SoftBody) are added.

提示

該模組接受以下變數:

BULLET_ROOT

Can be set to Bullet install path or Windows build path to specify where to find Bullet.

已棄用的變數

The following variables are provided for backward compatibility:

BULLET_FOUND

在 4.2 版之後被棄用: Use Bullet_FOUND, which has the same value.

Boolean indicating whether Bullet was found.

範例

Finding Bullet and conditionally creating an interface imported target that encapsulates its usage requirements for linking to a project target:

find_package(Bullet)

if(Bullet_FOUND AND NOT TARGET Bullet::Bullet)
  add_library(Bullet::Bullet INTERFACE IMPORTED)
  set_target_properties(
    Bullet::Bullet
    PROPERTIES
      INTERFACE_INCLUDE_DIRECTORIES "${BULLET_INCLUDE_DIRS}"
      INTERFACE_LINK_LIBRARIES "${BULLET_LIBRARIES}"
  )
endif()

target_link_libraries(example PRIVATE Bullet::Bullet)