Meazure is a Qt program and must be built on Linux. These instructions describe how to build Meazure for Ubuntu 20.04 using CMake.
-
Download and install CMake 3.24 or newer for Linux x86_64 from https://cmake.org/download/
-
Download and install Ninja 1.11.0 or newer for Linux https://github.com/ninja-build/ninja/releases
-
Ensure that
cmake
andninja
are in the PATH -
Install Python
sudo apt-get install python3 sudo apt-get install python3-pip
-
Install the Conan C/C++ Package Manager
pip install conan
-
Install the cmakelang tools
pip install cmakelang
-
Install clang-tidy-15
-
Install Doxygen
sudo apt-get install doxygen sudo apt-get install doxygen-latex sudo apt-get install graphviz
-
Meazure uses the Qt Framework. This dependency is obtained and built locally by the Conan package manager. Becausse it is built locally from source, Qt requires a number of development packages to be installed on the system. Conan lists the missing dependencies during the build. Besides the compiler and its toolchain, you are given the option to either install the development packages manually or have Conan do it automatically. The following are the packages that need to be installed on the system (note that the actual packages may vary).
sudo apt-get install libfontenc-dev libice-dev libgl-dev libsm-dev libx11-xcb-dev libxaw7-dev libxcb-dri3-dev \ libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev \ libxcb-render-util0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-util-dev \ libxcb-util0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcomposite-dev \ libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev \ libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev \ libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev uuid-dev
-
The following targets are of interest:
- project_full_build - Builds the Meazure executable, runs all tests, generates API documentation, lints the CMakeLists.txt files and creates Debian package.
- meazure - Builds the Meazure executable.
- project_test - Runs all unit tests.
- project_package - Creates the Debian package.
- clean - Deletes all build artifacts.
- cmakelint - Lints the CMakeLists.txt files.
- apidocs - Generates the API documentation.
To run these targets, use the following command:
./build.sh -t [release|debug] <target>
This section describes the configuration of the JetBrains CLion IDE so that it can be used to develop, run and debug the Meazure project. The primary goal of this configuration is to ensure that the IDE uses the same toolchain as the command line build. In addition, to avoid conflicts, this configuration ensures that the IDE output directory is separate from the command line build output directory.
Note that the tool installation location may vary from those shown.
- Start the CLion IDE
- Open the Meazure project
- Configurea a toolchain
- Select Settings > Build, Execution, Deployment > Toolchains
- Press + and System to add a new toolchain
- Specify Name: Meazure
- Specify CMake: /opt/cmake/bin/cmake
- Specify Build Tool: /opt/ninja/ninja
- Press OK
- Configure CMake profiles
- Select Settings > Build, Execution, Deployment > CMake
- Select the Debug profile
- For Toolchain select Meazure
- Verify the name of the profile is changed to Release-Meazure
- For Build directory specify out/debug
- Press Apply
- Press +
- Select the Release profile
- For Toolchain select Meazure
- Verify the name of the profile is changed to Release-Meazure
- For Build directory specify out/release
- Press OK
- Delete any build directories other than out
- Configure clang-tidy
- Select Settings > Languages and Frameworks > C/C++ > Clang-Tidy
- Check the box Use external Clang-Tidy instead of the built-in one
- Specify /usr/bin/clang-tidy-15
- Press OK