Setting up Box2D 2.4.2 in Visual Studio 2022 using CMake
        
            - Install Box2D 2.4.2 using this guide: How to install Box2D 2.4.2 using CMake and Visual Studio 2022 for Desktop
 
            - Run Visual Studio
 
            - Click on the "Create a new project" button:
 
            
            - Click on the "CMake Project" and click on the "Next" button:
 
            
            - Type a project name, set a project location, check the "Place solution and project in the same directory" checkbox, and click on the "Create" button:
 
            
            - Wait a few seconds for configuration
 
            - Run the project by click on the empty green triangle (or Ctrl+F5):
 
            
            - The program prints "Hello CMake" to the console:
 
            
            - Double click on the "CMakePresets.json" file:
 
            
            - Add the "box2d_DIR" variables for "Debug" and "Release" to the "cacheVariables" sections:
 
        {
            "name": "x64-debug",
            "displayName": "x64 Debug",
            "inherits": "windows-base",
            "architecture": {
                "value": "x64",
                "strategy": "external"
            },
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Debug",
                "box2d_DIR": {
                    "value": "E:/libs/box2d-2.4.2-msvc/win/debug/lib/cmake/box2d",
                    "type": "PATH"
                }
            }
        },
        {
            "name": "x64-release",
            "displayName": "x64 Release",
            "inherits": "x64-debug",
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Release",
                "box2d_DIR": {
                    "value": "E:/libs/box2d-2.4.2-msvc/win/release/lib/cmake/box2d",
                    "type": "PATH"
                }
            }
        },
            Double click on the "CMakeLists.txt" file:
            
            Add this code to the "CMakeLists.txt" file
find_package(box2d)
target_link_libraries(hello-box2d-v2-cpp PRIVATE box2d::box2d)
            Replace the "hello-box2d-v2-cpp.cpp" file content with the following one:
#include <box2d/box2d.h>
#include <iostream>
int main()
{
    b2Vec2 gravity(0.f, -9.8f);
    b2World* world = new b2World(gravity);
    float gx = world->GetGravity().x;
    float gy = world->GetGravity().y;
    std::cout << "gravity = (" << gx << ", " << gy << ")" << std::endl;
    return 0;
}
            
            Press Ctrl+F5 to run the application
            You see a value of gravity: