Box2D and Cmake - Error, project files may be invalid

Hi everybody,

I'm new to Box2D, but want to use it with SFML. I was following this tutorial, but when I press the configure button on Cmake (v3.0.0), I get an error that says, Error in configuration process, project files may be invalid. I'm using the latest version of Box2D, I used the svn link on the homepage, and the latest version of cmake.

This is the output:

Code: Select all

The C compiler identification is MSVC 18.0.30501.0
The CXX compiler identification is MSVC 18.0.30501.0
Check for working C compiler using: Visual Studio 12 2013
Check for working C compiler using: Visual Studio 12 2013 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 12 2013
Check for working CXX compiler using: Visual Studio 12 2013 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Found OpenGL: opengl32 
CMake Error at CMakeLists.txt:29 (add_subdirectory):
  add_subdirectory given source "freeglut" which is not an existing
  directory.


CMake Error at CMakeLists.txt:30 (add_subdirectory):
  add_subdirectory given source "glui" which is not an existing directory.


Configuring incomplete, errors occurred!
See also "C:/SFML/Box2D/Build/CMakeFiles/CMakeOutput.log".


What am I doing wrong and how can I fix this problem? I've used JBox2d before and I'm a big fan, but now I want to use it with c++ and to be honest, this has taken way too long to figure out.

Thank you!
I would suggest that you just add all the Box2D source files to your project directly, rather than building a library to link with. It's not that big, so it will make very little difference to the size of your binary or the time taken to link, and will probably make it easier to step into the code and see what's going on when you need to debug something.
Ok thanks! I did that and it worked perfectly!

Original thread: https://box2d.org/forum/viewtopic.php?t=9839