Skip to content

Linux build instructions

adazem009 edited this page Mar 18, 2024 · 3 revisions

Installing Qt

ScratchCPP Player needs Qt 6.6. You can use the aqt-install tool to install it (make sure you have Python installed):

pip install -U pip
pip install aqtinstall

aqt install-qt linux desktop 6.6 gcc_64 -m qtimageformats --outputdir ~/Qt

Qt will be installed in the ~/Qt directory.

Alternatively, the official Qt installer can be used. Just make sure you check the required Qt modules (Qt Image Formats).

Building (command line)

Clone the ScratchCPP Player repository:

git clone https://github.com/scratchcpp/scratchcpp-player --recurse-submodules
cd scratchcpp-player

Create a build directory:

mkdir build_files
cd build_files

Tell CMake to use the Qt installation you've installed and configure the project:

export CMAKE_PREFIX_PATH=$(echo ~/Qt/*/gcc_64):$CMAKE_PREFIX_PATH # replace the asterisk with the installed Qt version if you have more versions installed
cmake ..

And to build and run the application:

cmake --build . -j$(nproc --all)
./src/scratchcpp-player
Clone this wiki locally