如何在 10 分钟内在 Ubuntu 上构建 KiCad

此命令序列可用于在 Ubuntu 上快速编译 KiCad

添加仓库以便我们可以安装构建依赖

build_kicad_ubuntu.sh
sudo add-apt-repository --enable-source --yes ppa:kicad/kicad-8.0-releases
sudo apt update

安装构建依赖

install_dependencies.sh
sudo apt build-dep kicad
# Install other build tools
apt -y install ninja-build mold libprotobuf-dev protobuf-compiler python3-pip
# Install Python dependencies
pip install --user --break-system-packages wxpython

克隆 KiCad 源代码

clone_kicad.sh
git clone https://gitlab.com/kicad/code/kicad.git

可选地,你可以检出特定分支,但大多数用户会想要构建 master,这是默认检出的。

使用 ninja 构建 KiCad

build_kicad.sh
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo -DCMAKE_CXX_FLAGS=-fuse-ld=mold ../../
ninja -j8

Check out similar posts by category: KiCad, Linux