favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Better switching between single/double precision #498

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Compile bullet with double precision
2. Create a project with bullet
3. Compile/link without double precision

One solution would be to use cmake to create a "config.h.in" file containing:

#cmakedefine BT_USE_DOUBLE_PRECISION

Which would then be translated by cmake to "config.h" via

SET(BT_USE_DOUBLE_PRECISION ${USE_DOUBLE_PRECISION})
CONFIGURE_FILE(
  config.h.in
  ${CMAKE_BINARY_DIR}/include/LinearMath/config.h)

and which would then be included in btScalar.h.

See also this http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=6570 
thread. 

Original issue reported on code.google.com by phillem...@gmail.com on 1 Apr 2011 at 1:17

GoogleCodeExporter commented 9 years ago
including a config.h by btScalar.h isn't an option, because we want to keep 
Bullet compiling out-of-the-box from Visual Studio without any modifications.

Both autotools and cmake have already the option to 'install' Bullet and 
generate a bullet.pc file, that includes the double precision C flags.
See bullet.pc.cmake (cmake) and
bullet.pc.in (autotools)

Have you tried using those?

Have you checked those options?

Original comment by erwin.coumans on 1 Apr 2011 at 4:29

GoogleCodeExporter commented 9 years ago
See also http://en.wikipedia.org/wiki/Pkg-config

Original comment by erwin.coumans on 2 Apr 2011 at 12:54

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 5 Apr 2011 at 9:40