Skip to content

rebaze

Automate your migration from CMake and Gradle to Bazel.
Terminal window
# Add the tap and install
brew tap albertocavalcante/tap
brew install albertocavalcante/tap/rebaze
# Migrate your project
rebaze migrate /path/to/your/project

That’s it. Your CMake or Gradle project now has Bazel build files.

Fast Migration

Analyze and migrate your project in seconds. No manual BUILD file writing required.

Smart Dependencies

Automatically maps CMake find_package() and Gradle dependencies to Bazel targets.

Configurable

Customize mappings, rules, and strategies via rebaze.toml configuration.

Hermetic Builds

Optional source builds with rules_foreign_cc for fully reproducible builds.

CMakeSupported

Full parser + cmake-file-api integration

GradleSupported

Groovy and Kotlin DSL

MavenPlanned

Detection only

Before: CMakeLists.txt

cmake_minimum_required(VERSION 3.14)
project(myapp)
find_package(ZLIB REQUIRED)
add_library(mylib src/lib.cpp)
target_link_libraries(mylib ZLIB::ZLIB)
add_executable(myapp src/main.cpp)
target_link_libraries(myapp mylib)

After: Run rebaze migrate .

MODULE.bazel
module(name = "myapp", version = "0.1.0")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "zlib", version = "1.3.1")
BUILD.bazel
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
cc_library(
name = "mylib",
srcs = ["src/lib.cpp"],
deps = ["@zlib"],
)
cc_binary(
name = "myapp",
srcs = ["src/main.cpp"],
deps = [":mylib"],
)