You are not logged in.
Hi, I am trying to compile a cmake based project that uses the bullet physics simulation library which is found in the extra repository.
In my CMakeLists.txt file i have
find_package(Bullet CONFIG REQUIRED)
which doesn't fail as confirmed by this output:
-- BULLET_FOUND="1" ; BULLET_INCLUDE_DIR="include/bullet" ; BULLET_INCLUDE_DIRS="include/bullet" ; BULLET_LIBRARIES="LinearMath;Bullet3Common;BulletInverseDynamics;BulletCollision;BulletDynamics;BulletSoftBody"
However compilation fails as the BULLET_INCLUDE_DIR is not a full path as it should be (ie /usr/include/bullet)
Does anyone have an idea what am i doing wrong or if I should file a bug report somewhere?
Thanks
Last edited by nspattak (2024-06-05 23:05:41)
Offline
I've had to deal with cmake for building packages and often had to look into *.cmake files to figure out what went wrong .
run pacman -Ql cmake | grep -i bullet .
It will list 3 files , look in the *.cmake one .
Once you found the lines dealing with include dirs, look at the *.html file you also found .
find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
HINTS
${BULLET_ROOT}/include
${BULLET_ROOT}/src
PATH_SUFFIXES bullet
)
Also check cmake docs for the findbullet module and notice it accepts 1 variable : BULLET_ROOT .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Hi mate, thank you for the help, I already took note of these pacman options for future reference
I found all the files you are mentioning and I think I am using them correctly.
The BULLET_ROOT parameter can be used to help cmake find the .cmake files required to locate the library and shouldn't be required on a properly compiled and installed library.
Do you think there might be an upstream bug or an arch package bug? I would be surprised if I were the first one to find it.
Do you know if I can/should contact the package maintainer about it?
Last edited by nspattak (2024-06-07 15:25:53)
Offline
What are you passing to cmake as the value for BULLET_ROOT?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
What are you passing to cmake as the value for BULLET_ROOT?
Nothing. Why would i need to use this? bullet is installed using pacman and cmake correctly picks up everything, the thing is that the values found apparently are not correct:
BULLET_INCLUDE_DIR="include/bullet" ; BULLET_INCLUDE_DIRS="include/bullet" ; BULLET_LIBRARIES="LinearMath;Bullet3Common;BulletInverseDynamics;BulletCollision;BulletDynamics;BulletSoftBody"
out of curiosity, i just tried setting BULLET_ROOT to /usr and i had exactly the same behavior.
Last edited by nspattak (2024-06-07 15:32:08)
Offline
Try the module mode
find_package(Bullet MODULE REQUIRED)
The config mode uses the CMake file provided by bullet, which only sets a relative path for BULLET_INCLUDE_DIR.
Offline
Try the module mode
find_package(Bullet MODULE REQUIRED)
The config mode uses the CMake file provided by bullet, which only sets a relative path for BULLET_INCLUDE_DIR.
You are awesome! This works and I wouldn't have thought of trying it.
AFAIK the module mode is for cmake files located in a project, not for packages installed in the system. Could it be that the upstream provided files are wrong?
Offline