Cmake and Visual Studio

I've never used Cmake before, but it seems to be rather straight forward. However, I can't seem to create a Visual Studio project file from the cmake file. I tried pointing it to the Box2D source library (working with latest SVN), but it did not generate any useful project files. Then I tried the testbed and it worked, but for the testbed only (box2d was not build)

How exactly do I generate the project files (using Windows)?
Did you read Building.txt?
Code:
Box2D uses CMake to describe the build in a platform independent manner.

First download and install cmake from cmake.org

For Microsoft Visual Studio:
- Run the cmake-gui
- Set the source directory to the path of Box2D on your PC (the folder that contains this file).
- Set the build directory to be the path of Box2D/Build on your PC.
- Press the Configure button and select your version of Visual Studio.
- You may have to press the Configure button again.
- Press the Generate button.
- Open Box2D/Build/Box2D.sln.
- Set the Testbed or HelloWorld as your startup project.
- Press F5 or Ctrl-F5 to run.
Nope, did not see it. Sorry about that.
I followed the Building.txt file and it doesn't really implement the project settings properly.

It uses absolute positions to the folders or files! So I can't move my project without manually changing all the references in the project settings.

Is there a way to get CMake to set up relative paths in the project settings.
There must be! Or I'll go insane. 👿
Ulf wrote:
It uses absolute positions to the folders or files! So I can't move my project without manually changing all the references in the project settings.


If you are serious about using Box2D, you might want to create your own project. CMake is there to get Box2D (and the testbed) running quickly on many platforms.
Erin Catto wrote:
If you are serious about using Box2D, you might want to create your own project. CMake is there to get Box2D (and the testbed) running quickly on many platforms.

Ok. I suppose I'll just use the VS projects/solutions created with CMake and edit any path that is absolute. It won't take so long I suppose.
But I thought it was a bit strange that some of the paths are absolute whereas some are relative.
Yeah, CMake does some interesting things in the project. I don't know if it is possible to control this.

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