Skip to content

How to build 如何构建

Flex Zhong edited this page Jul 30, 2020 · 4 revisions

You can refer to our CI file.

你可以参考我们的 CI 文件

Required Tools

Required Dependencies

Notepanda uses git submodules for some of its dependencies. To make sure submodules are restored or updated, be sure to run the following prior to building:

Notepanda 使用 git submodules 处理它的一些依赖关系。为了确保子模块被恢复或更新,请确保在构建之前运行以下内容:

git submodule update --init --recursive

If you don't want to build KSyntaxHighlighting yourself or it’s difficult to build (especially under Windows), you can use Craft - an open source meta build system and package manager. by KDE:

如果你不想自己构建 KSyntaxHighlighting 或者难以构建(尤其是在 Windows 系统下),你可以使用 Craft - 一个开源的元构建系统和程序包管理器。KDE 制作:

craft syntax-highlighting

Then, you can ignore the Build ECM and Build KSyntaxHighlighting sections below.

然后,您可以忽略下面的 Build ECMBuild KSyntaxHighlighting 部分。

Linux / MacOS

# Build ECM
cd src/3rdparty/extra-cmake-modules
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
cmake --build .
cmake --build . --target install

# Build KSyntaxHighlighting
cd ../../syntax-highlighting
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . --parallel $(nproc)
cmake --build . --target install

# Build Notepanda
cd ../../../../
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./AppDir/usr
cmake --build . --parallel $(nproc)
cmake --install .

Windows

# Build ECM
cd src/3rdparty/extra-cmake-modules
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build .
cmake --build . --target install

# Build KSyntaxHighlighting
cd ../../syntax-highlighting
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build . 
cmake --build . --target install

# Build Notepanda
cd ../../../../
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=Release -DKF5SyntaxHighlighting_DIR="C:/Program Files (x86)/ECM/lib/cmake/KF5SyntaxHighlighting"
cmake --build . --parallel $(nproc)
cmake --install .

We need you! Join us to develop together! :smiley:

Clone this wiki locally