[solved] [linux] includes not found with cmake

Post Reply
nicoo
Posts: 7
Joined: Wed Apr 01, 2015 4:07 pm

[solved] [linux] includes not found with cmake

Post by nicoo »

hi :)

I have a common problem, "include not found". While I was using the command line to set the includes and libraries directories everything was fine,
g++ src/B_engine.cc -lLinearMath -lBulletSoftBody -lBulletCollision -lBulletDynamics -I/usr/include/bullet -o a.out
but I need to make it working with cmake, there is a copy of my current cmake,
cmake_minimum_required( VERSION 2.8 )
project( a.out )
set( SOURCES src/B_engine.cc )
set( EXECUTABLE_NAME a.out )
find_package( Bullet REQUIRED )
add_executable( ${EXECUTABLE_NAME} ${SOURCES} )
add_definitions(-std=c++11)
when I do a "ccmake .", I see :
BULLET_INCLUDE_DIR /usr/include/bullet
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /usr/local
so, me (with the command line) and cmake are expecting to use /usr/include/bullet as directory. But when I do "make", I get this error :

Code: Select all

[100%]
Scanning dependencies of target a.out
Building CXX object CMakeFiles/a.out.dir/src/B_engine.cc.o
In file included from /home/user/test/src/B_engine.cc:2:0:/home/user/test/src/B_engine.hh:5:36: fatal error: btBulletDynamicsCommon.h: No such file or directory
 #include <btBulletDynamicsCommon.h>
I do not understand why the g++ command line and cmake doesn't give the same result.
nicoo
Posts: 7
Joined: Wed Apr 01, 2015 4:07 pm

Re: [solved] [linux] includes not found with cmake

Post by nicoo »

Post Reply