You can build a project with CMake by using the following steps.
First, make sure you have installed CMake on your system. If not, you can download it from the official website and follow the instructions provided there for your specific operating system.
To build a CMake project, you need a CMakeLists.txt file which directs the build process.
This should already be present if you have a CMake-based project.
Here's the general process:
-
install required packages and libs using
vcpkgjson file -
Open a command prompt/terminal and navigate to your project directory.
-
Create a new directory (usually build) and move into this directory (Because it is a good practice to do an "out-of-source" build rather than build in your source directory):
mkdir build
-
Run cmake
{options} .from this directorycmake . -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg
After running cmake, run cmake --build . to actually build your project.
You can use --config Release to specify a build type.
-
build with cmake profile
DLLfile for SKSEcmake --build . --config Release/Debug