You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm beginning to use bullet in a cpp/cmake project, and i face small issue on telling where are the bullet includes.
I use find_package to the BulletConfig.cmake, which look like this :
# -*- cmake -*-## BulletConfig.cmake(.in)## Use the following variables to compile and link against Bullet:# BULLET_FOUND - True if Bullet was found on your system# BULLET_USE_FILE - The file making Bullet usable# BULLET_DEFINITIONS - Definitions needed to build with Bullet# BULLET_INCLUDE_DIR - Directory where Bullet-C-Api.h can be found# BULLET_INCLUDE_DIRS - List of directories of Bullet and it's dependencies# BULLET_LIBRARIES - List of libraries to link against Bullet library# BULLET_LIBRARY_DIRS - List of directories containing Bullet' libraries# BULLET_ROOT_DIR - The base directory of Bullet# BULLET_VERSION_STRING - A human-readable string containing the versionset ( BULLET_FOUND 1 )
set ( BULLET_USE_FILE "lib/cmake/bullet/UseBullet.cmake" )
set ( BULLET_DEFINITIONS "" )
set ( BULLET_INCLUDE_DIR "include/bullet" )
set ( BULLET_INCLUDE_DIRS "include/bullet" )
set ( BULLET_LIBRARIES "LinearMath;Bullet3Common;BulletInverseDynamics;BulletCollision;BulletDynamics;BulletSoftBody" )
set ( BULLET_LIBRARY_DIRS "lib" )
set ( BULLET_ROOT_DIR "/Users/aaa/Documents/repos/banditdep" )
set ( BULLET_VERSION_STRING "3.24" )
And in my CMakeLists.txt, i should do :
target_include_directories(Mylib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/Mylib>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
"${BULLET_ROOT_DIR}/${BULLET_INCLUDE_DIRS}"
)
But when i add other libraries, i just do XXX_INCLUDE_DIRS.
So, i think BulletConfig.cmake.in should have this modification
diff --git a/BulletConfig.cmake.in b/BulletConfig.cmake.in
index f5dc7bd..e6005bc 100644
--- a/BulletConfig.cmake.in
+++ b/BulletConfig.cmake.in
@@ -17,9 +17,9 @@
set ( BULLET_FOUND 1 )
set ( BULLET_USE_FILE "@BULLET_USE_FILE@" )
set ( BULLET_DEFINITIONS "@BULLET_DEFINITIONS@" )
-set ( BULLET_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@" )
-set ( BULLET_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@" )
+set ( BULLET_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@" )
+set ( BULLET_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@" )
set ( BULLET_LIBRARIES "@BULLET_LIBRARIES@" )
-set ( BULLET_LIBRARY_DIRS "@LIB_DESTINATION@" )
+set ( BULLET_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/@LIB_DESTINATION@" )
set ( BULLET_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" )
-set ( BULLET_VERSION_STRING "@BULLET_VERSION@" )
\ No newline at end of file
+set ( BULLET_VERSION_STRING "@BULLET_VERSION@" )
What do you think about that ?
I already see the previous commits about relative/absolute path, concerning pkgconfig file. In fact, i propose to use absolute path in CMake instead of editing the pkgconfig file.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm beginning to use bullet in a cpp/cmake project, and i face small issue on telling where are the bullet includes.
I use find_package to the BulletConfig.cmake, which look like this :
And in my CMakeLists.txt, i should do :
But when i add other libraries, i just do XXX_INCLUDE_DIRS.
So, i think BulletConfig.cmake.in should have this modification
What do you think about that ?
I already see the previous commits about relative/absolute path, concerning pkgconfig file. In fact, i propose to use absolute path in CMake instead of editing the pkgconfig file.
Beta Was this translation helpful? Give feedback.
All reactions