You are not logged in.

#1 2024-06-05 22:48:44

nspattak
Member
From: Greece
Registered: 2008-05-21
Posts: 26

bullet headers not found in cmake based project

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

#2 2024-06-06 10:24:29

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,322

Re: bullet headers not found in cmake based project

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.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2024-06-07 14:12:43

nspattak
Member
From: Greece
Registered: 2008-05-21
Posts: 26

Re: bullet headers not found in cmake based project

Hi mate, thank you for the help, I already took note of these pacman options for future reference smile
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

#4 2024-06-07 15:21:17

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 12,117
Website

Re: bullet headers not found in cmake based project

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

#5 2024-06-07 15:31:37

nspattak
Member
From: Greece
Registered: 2008-05-21
Posts: 26

Re: bullet headers not found in cmake based project

WorMzy wrote:

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

#6 2024-06-07 15:56:49

someUser
Member
Registered: 2021-01-03
Posts: 16

Re: bullet headers not found in cmake based project

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

#7 2024-06-08 16:29:56

nspattak
Member
From: Greece
Registered: 2008-05-21
Posts: 26

Re: bullet headers not found in cmake based project

someUser wrote:

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

Board footer

Powered by FluxBB