I’m trying to build QGroundControl using CMake. My build script is as follows:
#!/bin/sh
Qt5_DIR=~/Qt/5.12.6/gcc_64/lib/cmake/Qt5
mkdir -p ~/build/$1
cd ~/build/$1
mkdir -p gdbg
mkdir -p grel
mkdir -p gins
mkdir -p gafl
mkdir -p cdbg
mkdir -p crel
mkdir -p cins
mkdir -p cafl
cd gdbg
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ~/src/$1
cd ../grel
cmake -GNinja -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ~/src/$1
cd ../gins
cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ~/src/$1
cd ../gafl
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=afl-gcc -DCMAKE_CXX_COMPILER=afl-g++ -DNO_INSTALL=1 ~/src/$1
cd ../cdbg
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ~/src/$1
cd ../crel
cmake -GNinja -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ~/src/$1
cd ../cins
cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ~/src/$1
cd ../cafl
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_C_COMPILER=afl-clang -DCMAKE_CXX_COMPILER=afl-clang++ -DNO_INSTALL=1 ~/src/$1
The only difference from my usual build script, which I use for my C++ projects, is setting the Qt5_DIR
variable.
When I run ninja, I get this error:
In file included from /home/phma/src/qgroundcontrol/src/Vehicle/Vehicle.cc:52:
In file included from /home/phma/src/qgroundcontrol/src/Vehicle/EventHandler.h:18:
/home/phma/src/qgroundcontrol/src/Vehicle/HealthAndArmingChecks.h:16:10: fatal error: 'libevents/libs/cpp/parse/parser.h' file not found
#include <libevents/libs/cpp/parse/parser.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I searched the Internet for an Ubuntu package providing this file and found none. So I ran locate
and found that it’s at /home/phma/src/qgroundcontrol/libs/libevents/libevents/libs/cpp/parse/parser.h
.
This is the first time I’ve even heard of submodules in Git. Since the filename is in brokets, I’m guessing that it’s in a submodule which has to be installed before I can compile the main program. How do I do this?