Skip to content
Snippets Groups Projects
Commit 90d4b55c authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

make bullet into its own module

parent 09c55805
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,7 @@ add_subdirectory( fggl )
target_compile_options( fggl PRIVATE -Wall -Wpedantic -Wextra -Wodr -fno-strict-aliasing -fno-strict-overflow )
set_property(TARGET fggl PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
# 3rd party integrations
add_subdirectory( integrations/bullet )
# vendor dependencies
add_subdirectory( integrations/entt )
# Unit Tests
......@@ -129,3 +127,6 @@ export(EXPORT "${PROJECT_NAME}Targets"
NAMESPACE ${namespace}::
)
# 3rd party integrations
add_subdirectory( integrations/bullet )
......@@ -15,7 +15,7 @@ target_include_directories(demo
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries(demo fggl)
target_link_libraries(demo fggl fgglbt)
find_package(spdlog)
target_link_libraries(demo spdlog::spdlog)
......
......@@ -5,32 +5,35 @@ if ( NOT Bullet_FOUND )
else()
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(fggl PUBLIC LinearMath Bullet3Common BulletDynamics BulletSoftBody BulletCollision BulletInverseDynamics)
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(fggl PUBLIC ${BULLET_DEFINITIONS})
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(fggl PUBLIC ${BULLET_ROOT_DIR}/${BULLET_INCLUDE_DIRS})
target_include_directories(fgglbt PUBLIC ${BULLET_ROOT_DIR}/${BULLET_INCLUDE_DIRS})
else()
target_include_directories(fggl PUBLIC ${BULLET_INCLUDE_DIRS})
target_include_directories(fgglbt PUBLIC ${BULLET_INCLUDE_DIRS})
endif()
target_link_libraries(fggl PUBLIC ${BULLET_LIBRARIES})
target_link_libraries(fgglbt PUBLIC ${BULLET_LIBRARIES})
endif()
target_include_directories( fggl
target_link_libraries( fgglbt PUBLIC fggl )
target_include_directories( fgglbt
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:include>
)
# bullet cpp files
target_sources( fggl
target_sources( fgglbt
PRIVATE
src/module.cpp
src/simulation.cpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment