Doxygen - 找不到 FLEX(缺失:FLEX_EXECUTABLE)

Doxygen - Could NOT find FLEX (missing: FLEX_EXECUTABLE)

我知道这里有措辞非常相似的问题,但我在那里找不到我的问题的答案,所以我们开始吧:
我试图查看我的哪些 C++ 方法被其他人调用,所以我在谷歌搜索后找到了 Doxygen。
在他们的 page 上,安装看起来非常简单:

If you have the necessary build tools installed (i.e. g++, python, cmake, flex, bison), you should do the following to get the initial copy of the repository:

git clone https://github.com/doxygen/doxygen.git
cd doxygen
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make

直到 cmake -G "Unix Makefiles" .. 一切顺利,然后在该命令上出现以下错误:

test@test-VirtualBox:~/doxygen/build$ cmake -G "Unix Makefiles" ..
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find FLEX (missing: FLEX_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindFLEX.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:84 (find_package)

我想:没什么大不了的,为什么要开箱即用...看来我必须安装 flex
所以我这样做:
sudo apt-get update
sudo apt-get install flex
sudo apt autoremove(因为安装后命令行建议我这样做)

现在看来 flex 已经安装好了,我再次尝试 cmake -G "Unix Makefiles" .....同样的错误。我关闭命令行,重新启动它,再试一次 - 同样的错误...
所以现在我慢慢开始生气并转向 Stack Overflow 寻求帮助 :D
我究竟做错了什么???

因为我看到有人在另一个问题的评论中问这个问题,所以这里是 flex 的输出:

test@test-VirtualBox:~/doxygen/build$ flex
The program 'flex' can be found in the following packages:
 * flex
 * flex-old
Try: sudo apt install <selected package>

好像apt autoremove真的删除了我上一步刚安装的包
所以对我有用的是:

git clone https://github.com/doxygen/doxygen.git
cd doxygen
mkdir build
cd build

这些是新的:


sudo apt-get install flex
sudo apt-get install bison

cmake -G "Unix Makefiles" ..
make

...但恐怖当然不会就此结束,参见 :D