Skip to content

Building

Jesse Knaapen edited this page Feb 26, 2024 · 3 revisions

You can build this project for

I have no way to run MacOS. So anyone who uses MacOS, feel free to help.

Windows MSVC

Requirements

  • Visual Studio - Software Distribution and Building Platform for Windows

    • If you don't want install the Visual Studio IDE, go to 'Tools For Visual Studio' and download 'Build Tools for Visual Studio' instead
    • Select 'Desktop development with C++', note that in the optional components (right side) CMake will be selected
  • Qt (Latest version)

    • If you don't want to use the Qt installer, than you can use aqt, see aqt-list for help with command arguments.

Compile from command line.

You will need to run commands from x64 Native Tools Command Prompt or x86 Native Tools Command Prompt depending on if you are building 64bit or 32bit. These instructions assume you are using the x64 Native Tools Command Prompt to build for 64bit. All commands are for a debug build, for release builds, replace Debug with Release in the cmake commands.

  1. cd to the folder you cloned StudyGuide to.

  2. Now we can prepare the build itself: Run cmake -Bbuild -DCMAKE_PREFIX_PATH=C:\Qt\6.6.1\msvc2019_64\lib\cmake -G Ninja.

    • If you have installed a different version, change 6.6.1 to your version.
    • If you have installed Qt in a non-default location, then change the CMAKE_PREFIX_PATH to -DCMAKE_PREFIX_PATH=<Path to Qt Install>\6.6.1\msvc2019_64\lib\cmake, replacing <Path to Qt Install> with the path to your Qt install.
    • If you are building for 32bit, change msvc2019_64 to msvc2019.
  3. Now you need to run the build itself: Run cmake --build build.

  4. Now, wait for it to compile. This could take some time, so hopefully it compiles properly.

  5. Run the command cmake --install build --prefix install, and it should install StudyGuide to the install directory.

    • If you want StudyGuide to be installed somewhere else, change --prefix install to your desired location.

Linux

Getting the project to build and run on Linux is easy if you use any modern and up-to-date Linux distribution.

Build dependencies

  • A C++ compiler capable of building C++17 code.
  • Qt Development tools 6.0 or newer (qt6-base-dev qtchooser qt6-base-dev-tools libqt6core6 qt6-tools-dev on Debian (testing/unstable) based systems).
  • cmake 3.15 or newer (cmake on Debian-based system)
  • ninja (ninja-build on Debian-based systems)

Building

cmake -Bbuild
cmake --build build

Installing and running

You can install this program to your computer by running: sudo cmake --install build

And run it using: studyguide

Or you could install it to a custom directory with: cmake --install build --prefix install

  • If you want to install this to another directory you have to replace --prefix install with --prefix <INSTALL_DIRECROTY>
Clone this wiki locally