Skip to content
Snippets Groups Projects
CMakeLists.txt 1.7 KiB
Newer Older
# bullet integration support
find_package( Bullet CONFIG )
    message(WARNING "Bullet not found - disabling bullet physics integration")
    message( STATUS "Bullet is poorly packaged, you might need to disable support for it" )
    add_library(fgglbt STATIC)

    if ( MSVC )
        # see https://github.com/microsoft/vcpkg/issues/7877
        target_link_libraries(fgglbt PUBLIC LinearMath Bullet3Common BulletDynamics BulletSoftBody BulletCollision BulletInverseDynamics)
    else()
        # FIXME: this shouldn't be necessary, for modern cmake, linking the libraries should be enough
        target_compile_definitions(fgglbt PUBLIC ${BULLET_DEFINITIONS})

        if ( BULLET_INCLUDE_DIRS STREQUAL "include/bullet" )
            message( STATUS "Bullet include path is relative - hard-coding" )
            # FIXME possible debian packing bug: path is relative in BulletConfig.cmake
            # FIXME debian packaging bug: BulletConfig.cmake lists BulletInverseDynamics, but that's packaged in bullet-extras
            target_include_directories(fgglbt PUBLIC ${BULLET_ROOT_DIR}/${BULLET_INCLUDE_DIRS})
            target_include_directories(fgglbt PUBLIC ${BULLET_INCLUDE_DIRS})
        target_link_libraries(fgglbt PUBLIC ${BULLET_LIBRARIES})
    target_link_libraries( fgglbt PUBLIC fggl )
    target_include_directories( fgglbt
        PUBLIC
            $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
            $<INSTALL_INTERFACE:include>
    )
    target_sources( fgglbt
            src/module.cpp
            src/service.cpp