Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake install broken? #125

Closed
tomazos opened this issue Feb 14, 2020 · 5 comments
Closed

cmake install broken? #125

tomazos opened this issue Feb 14, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@tomazos
Copy link

tomazos commented Feb 14, 2020

When I cmake install reactphysics3d I get the directory:

<installdir>/include/reactphysics3d

but the following test program:

#include <reactphysics3d/reactphysics3d.h>

int main() {}

Doesn't compile:

$ cc -I <installdir> test.cc

error:

reactphysics3d/configuration.h:36:10:
    fatal error: containers/Pair.h: No such file or directory

This is because:

<installdir>/include/reactphysics3d/reactphysics3d.h

includes:

<installdir>/include/reactphysics3d/configuration.h

which has:

#include "containers/Pair.h"

But no containers directory is in the <installdir>

Am I missing something?

@macmv
Copy link

macmv commented Feb 19, 2020

It seemed to install all the header files without subdirectories. The install looked like this for me, when I had the same error:

Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libreactphysics3d.a
-- Installing: /usr/local/include/reactphysics3d/configuration.h
-- Installing: /usr/local/include/reactphysics3d/decimal.h
-- Installing: /usr/local/include/reactphysics3d/reactphysics3d.h
-- Installing: /usr/local/include/reactphysics3d/Body.h
-- Installing: /usr/local/include/reactphysics3d/CollisionBody.h
-- Installing: /usr/local/include/reactphysics3d/RigidBody.h
-- Installing: /usr/local/include/reactphysics3d/ContactPointInfo.h
-- Installing: /usr/local/include/reactphysics3d/ContactManifoldInfo.h
-- Installing: /usr/local/include/reactphysics3d/BroadPhaseAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/DynamicAABBTree.h
-- Installing: /usr/local/include/reactphysics3d/CollisionDispatch.h
-- Installing: /usr/local/include/reactphysics3d/DefaultCollisionDispatch.h
-- Installing: /usr/local/include/reactphysics3d/VoronoiSimplex.h
-- Installing: /usr/local/include/reactphysics3d/GJKAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/SATAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/NarrowPhaseAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/SphereVsSphereAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/CapsuleVsCapsuleAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/SphereVsCapsuleAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/SphereVsConvexPolyhedronAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/CapsuleVsConvexPolyhedronAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/ConvexPolyhedronVsConvexPolyhedronAlgorithm.h
-- Installing: /usr/local/include/reactphysics3d/AABB.h
-- Installing: /usr/local/include/reactphysics3d/ConvexShape.h
-- Installing: /usr/local/include/reactphysics3d/ConvexPolyhedronShape.h
-- Installing: /usr/local/include/reactphysics3d/ConcaveShape.h
-- Installing: /usr/local/include/reactphysics3d/BoxShape.h
-- Installing: /usr/local/include/reactphysics3d/CapsuleShape.h
-- Installing: /usr/local/include/reactphysics3d/CollisionShape.h
-- Installing: /usr/local/include/reactphysics3d/ConvexMeshShape.h
-- Installing: /usr/local/include/reactphysics3d/SphereShape.h
-- Installing: /usr/local/include/reactphysics3d/TriangleShape.h
-- Installing: /usr/local/include/reactphysics3d/ConcaveMeshShape.h
-- Installing: /usr/local/include/reactphysics3d/HeightFieldShape.h
-- Installing: /usr/local/include/reactphysics3d/RaycastInfo.h
-- Installing: /usr/local/include/reactphysics3d/ProxyShape.h
-- Installing: /usr/local/include/reactphysics3d/TriangleVertexArray.h
-- Installing: /usr/local/include/reactphysics3d/PolygonVertexArray.h
-- Installing: /usr/local/include/reactphysics3d/TriangleMesh.h
-- Installing: /usr/local/include/reactphysics3d/PolyhedronMesh.h
-- Installing: /usr/local/include/reactphysics3d/HalfEdgeStructure.h
-- Installing: /usr/local/include/reactphysics3d/CollisionDetection.h
-- Installing: /usr/local/include/reactphysics3d/NarrowPhaseInfo.h
-- Installing: /usr/local/include/reactphysics3d/ContactManifold.h
-- Installing: /usr/local/include/reactphysics3d/ContactManifoldSet.h
-- Installing: /usr/local/include/reactphysics3d/MiddlePhaseTriangleCallback.h
-- Installing: /usr/local/include/reactphysics3d/BallAndSocketJoint.h
-- Installing: /usr/local/include/reactphysics3d/ContactPoint.h
-- Installing: /usr/local/include/reactphysics3d/FixedJoint.h
-- Installing: /usr/local/include/reactphysics3d/HingeJoint.h
-- Installing: /usr/local/include/reactphysics3d/Joint.h
-- Installing: /usr/local/include/reactphysics3d/SliderJoint.h
-- Installing: /usr/local/include/reactphysics3d/CollisionWorld.h
-- Installing: /usr/local/include/reactphysics3d/ConstraintSolver.h
-- Installing: /usr/local/include/reactphysics3d/ContactSolver.h
-- Installing: /usr/local/include/reactphysics3d/DynamicsWorld.h
-- Installing: /usr/local/include/reactphysics3d/EventListener.h
-- Installing: /usr/local/include/reactphysics3d/Island.h
-- Installing: /usr/local/include/reactphysics3d/Material.h
-- Installing: /usr/local/include/reactphysics3d/OverlappingPair.h
-- Installing: /usr/local/include/reactphysics3d/Timer.h
-- Installing: /usr/local/include/reactphysics3d/Timer.cpp
-- Installing: /usr/local/include/reactphysics3d/CollisionCallback.h
-- Installing: /usr/local/include/reactphysics3d/OverlapCallback.h
-- Installing: /usr/local/include/reactphysics3d/mathematics.h
-- Installing: /usr/local/include/reactphysics3d/mathematics_functions.h
-- Installing: /usr/local/include/reactphysics3d/Matrix2x2.h
-- Installing: /usr/local/include/reactphysics3d/Matrix3x3.h
-- Installing: /usr/local/include/reactphysics3d/Quaternion.h
-- Installing: /usr/local/include/reactphysics3d/Transform.h
-- Installing: /usr/local/include/reactphysics3d/Vector2.h
-- Installing: /usr/local/include/reactphysics3d/Vector3.h
-- Installing: /usr/local/include/reactphysics3d/Ray.h
-- Installing: /usr/local/include/reactphysics3d/MemoryAllocator.h
-- Installing: /usr/local/include/reactphysics3d/DefaultPoolAllocator.h
-- Installing: /usr/local/include/reactphysics3d/DefaultSingleFrameAllocator.h
-- Installing: /usr/local/include/reactphysics3d/DefaultAllocator.h
-- Installing: /usr/local/include/reactphysics3d/MemoryManager.h
-- Installing: /usr/local/include/reactphysics3d/Stack.h
-- Installing: /usr/local/include/reactphysics3d/LinkedList.h
-- Installing: /usr/local/include/reactphysics3d/List.h
-- Installing: /usr/local/include/reactphysics3d/Map.h
-- Installing: /usr/local/include/reactphysics3d/Set.h
-- Installing: /usr/local/include/reactphysics3d/Pair.h
-- Installing: /usr/local/include/reactphysics3d/Profiler.h
-- Installing: /usr/local/include/reactphysics3d/Logger.h

While the build looked like:

[  1%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/Timer.cpp.o
[  2%] Building CXX object CMakeFiles/reactphysics3d.dir/src/body/Body.cpp.o
[  4%] Building CXX object CMakeFiles/reactphysics3d.dir/src/body/CollisionBody.cpp.o
[  5%] Building CXX object CMakeFiles/reactphysics3d.dir/src/body/RigidBody.cpp.o
[  7%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/ContactManifoldInfo.cpp.o
[  8%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/broadphase/BroadPhaseAlgorithm.cpp.o
[ 10%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/broadphase/DynamicAABBTree.cpp.o
[ 11%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/DefaultCollisionDispatch.cpp.o
[ 13%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/GJK/VoronoiSimplex.cpp.o
[ 14%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/GJK/GJKAlgorithm.cpp.o
[ 16%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase
[ 17%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp.o
[ 19%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/CapsuleVsCapsuleAlgorithm.cpp.o
[ 20%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/SphereVsCapsuleAlgorithm.cpp.o
[ 22%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/SphereVsConvexPolyhedronAlgorithm.cpp.o
[ 23%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/CapsuleVsConvexPolyhedronAlgorithm.cpp.o
[ 25%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/narrowphase/ConvexPolyhedronVsConvexPolyhedronAlgorithm.cpp.o
[ 26%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/AABB.cpp.o
[ 27%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/ConvexShape.cpp.o
[ 29%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/ConvexPolyhedronShape.cpp.o
[ 30%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/ConcaveShape.cpp.o
[ 32%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/BoxShape.cpp.o
[ 33%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/CapsuleShape.cpp.o
[ 35%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/CollisionShape.cpp.o
[ 36%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/ConvexMeshShape.cpp.o
[ 38%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/SphereShape.cpp.o
[ 39%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/TriangleShape.cpp.o
[ 41%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/ConcaveMeshShape.cpp.o
[ 42%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/shapes/HeightFieldShape.cpp.o
[ 44%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/RaycastInfo.cpp.o
[ 45%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/ProxyShape.cpp.o
[ 47%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/TriangleVertexArray.cpp.o
[ 48%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/PolygonVertexArray.cpp.o
[ 50%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/TriangleMesh.cpp.o
[ 51%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/PolyhedronMesh.cpp.o
[ 52%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/HalfEdgeStructure.cpp.o
[ 54%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/CollisionDetection.cpp.o
[ 55%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/NarrowPhaseInfo.cpp.o
[ 57%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/ContactManifold.cpp.o
[ 58%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/ContactManifoldSet.cpp.o
[ 60%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/MiddlePhaseTriangleCallback.cpp.o
[ 61%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/BallAndSocketJoint.cpp.o
[ 63%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/ContactPoint.cpp.o
[ 64%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/FixedJoint.cpp.o
[ 66%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/HingeJoint.cpp.o
[ 67%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/Joint.cpp.o
[ 69%] Building CXX object CMakeFiles/reactphysics3d.dir/src/constraint/SliderJoint.cpp.o
[ 70%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/CollisionWorld.cpp.o
[ 72%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/ConstraintSolver.cpp.o
[ 73%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/ContactSolver.cpp.o
[ 75%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/DynamicsWorld.cpp.o
[ 76%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/Island.cpp.o
[ 77%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/Material.cpp.o
[ 79%] Building CXX object CMakeFiles/reactphysics3d.dir/src/engine/OverlappingPair.cpp.o
[ 80%] Building CXX object CMakeFiles/reactphysics3d.dir/src/collision/CollisionCallback.cpp.o
[ 82%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/mathematics_functions.cpp.o
[ 83%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Matrix2x2.cpp.o
[ 85%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Matrix3x3.cpp.o
[ 86%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Quaternion.cpp.o
[ 88%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Transform.cpp.o
[ 89%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Vector2.cpp.o
[ 91%] Building CXX object CMakeFiles/reactphysics3d.dir/src/mathematics/Vector3.cpp.o
[ 92%] Building CXX object CMakeFiles/reactphysics3d.dir/src/memory/DefaultPoolAllocator.cpp.o
[ 94%] Building CXX object CMakeFiles/reactphysics3d.dir/src/memory/DefaultSingleFrameAllocator.cpp.o
[ 95%] Building CXX object CMakeFiles/reactphysics3d.dir/src/memory/MemoryManager.cpp.o
[ 97%] Building CXX object CMakeFiles/reactphysics3d.dir/src/utils/Profiler.cpp.o
[ 98%] Building CXX object CMakeFiles/reactphysics3d.dir/src/utils/Logger.cpp.o

I don't have a solution, but I am having the same problem.

@DanielChappuis
Copy link
Owner

Hello. Thanks everyone for reporting this issue.

Yes, the issue is that cmake will copy the headers in the ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d/ in a flat way (without the subfolders) which is not working.

I have just pushed a fix in the "master" branch that will copy the headers in the ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d/ with the correct hierarchy of subdirectories.

Note that you might need to add the ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d/ directory as an "include directory" for your project so that the compiler correctly finds the ReactPhysics3D headers.

This is a temporary fix. For the next release of the library, I will change a little the structure of headers in the project so that it will be installed correctly with cmake.

@DanielChappuis DanielChappuis self-assigned this Feb 19, 2020
@DanielChappuis DanielChappuis added this to the Version 0.8.0 milestone Feb 19, 2020
@DanielChappuis
Copy link
Owner

DanielChappuis commented Feb 19, 2020

Duplicate of #106

@DanielChappuis DanielChappuis marked this as a duplicate of #106 Feb 19, 2020
@micrenda
Copy link

micrenda commented Apr 4, 2020

It is a known problem of CMake when using:
INSTALL(TARGETS ... PUBLIC_HEADER ... )

The workaround I found was to use INSTALL:

INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/" 
        DESTINATION "include/reactphysics3d"
        FILES_MATCHING  PATTERN "*.h"
)

@DanielChappuis
Copy link
Owner

The version v0.8.0 of ReactPhysics3D has been released. In this version, this issue is now fixed.

Note that this version contains some public API changes. Please read carefully the change log before upgrading to this new version and do not hesitate to take a look at the user manual.

Thanks for reporting this issue. I am now closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants