# Building Capstone This guide describes how to build Capstone with `CMake`. ## Build commands **Unix** ```bash cmake -B build -DCMAKE_BUILD_TYPE=Release # For debug build change "Release" to "Debug" cmake --build build cmake --install build --prefix "" ``` To create rpm, debian and OSX packages, run the following ```bash cmake -B build -DCMAKE_BUILD_TYPE=Release -DCAPSTONE_BUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr cmake --build build cd build cpack -G DEB cpack -G RPM cpack -G DragNDrop ``` **Windows** ```bash cmake.exe -B build cmake.exe --build build --config Release # For debug build change "Release" to "Debug" cmake.exe --install build ``` ## Tailor Capstone to your needs. Enable and disable options in the "configure" step (first `cmake` command from above). Options are added with `-D