Skip to main content

Bazel vs. CMake: Discover the advantages of Bazel migration

Picture of Krzysztof Romanowski, Head of Scala & Dev Tooling

Krzysztof Romanowski

Head of Scala & Dev Tooling
Apr 29, 2024|10 min read
Bazel_vs_CMake_Discover_the_advantages_of_Bazel_migration_image-min.jpg
1# CMakeLists.txt
2cmake_minimum_required(VERSION 3.0)
3project(MyProject)
4
5# Find Boost package
6find_package(Boost REQUIRED COMPONENTS filesystem)
7
8# Add source files
9set(SOURCES
10 main.cpp
11)
12
13# Define executable target
14add_executable(MyExecutable ${SOURCES})
15
16# Link the Boost filesystem library to the executable
17target_link_libraries(MyExecutable PRIVATE Boost::filesystem)
18
1# BUILD file
2cc_binary(
3 name = "my_executable",
4 srcs = ["main.cpp"],
5 deps = [“@boost//:filesystem”],
6)

Curated by Sebastian Synowiec

Subscribe to our newsletter and never miss an article