bullet3 icon indicating copy to clipboard operation
bullet3 copied to clipboard

bullet provided cmake config files are pointing to the wrong header file installation path resulting in BulletDynamics/Vehicle/btRaycastVehicle.h not found

Open pattakosn opened this issue 4 weeks ago • 0 comments

I am trying to compile a project using cmake. i have installed my linux distribuition package of bulled, bullet seems to be correctly found:

cmake ..
-- BULLET_FOUND="1" ; BULLET_INCLUDE_DIR="include/bullet" ; BULLET_INCLUDE_DIRS="include/bullet" ; BULLET_LIBRARIES="LinearMath;Bullet3Common;BulletInverseDynamics;BulletCollision;BulletDynamics;BulletSoftBody" ; BULLET_ROOT=""
-- PkgConfig::FREETYPE2="" ; PkgConfig::freetype2=""
-- Configuring done (0.0s)
-- Generating done (0.0s)

but I get this error:

cd build/runtime && /usr/bin/c++   -I/home/pattakosn/github.com/runtime/include/bullet  -O3 -DNDEBUG -std=gnu++20 -pthread -MD -MT runtime/CMakeFiles/runtime.dir/Physics/Car.cpp.o -MF CMakeFiles/runtime.dir/Physics/Car.cpp.o.d -o CMakeFiles/runtime.dir/Physics/Car.cpp.o -c /home/pattakosn/github.com/runtime/Physics/Car.cpp
/home/pattakosn/github.com/runtime/Physics/Car.cpp:32:10: fatal error: BulletDynamics/Vehicle/btRaycastVehicle.h: No such file or directory
   32 | #include <BulletDynamics/Vehicle/btRaycastVehicle.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

it seems to me that as the bullet include path is not an absolute path, it is incorrectly interpreted as relative to the current source dir which is obviously wrong.

edit: Apparently switching from find_package(Bullet CONFIG REQUIRED) to find_package(Bullet MODULE REQUIRED) fixes it but this is not how it is supposed to work.

pattakosn avatar Jun 07 '24 14:06 pattakosn