Cmake doesn't pickup where the required executable is (FLEX)


I’m trying to conifigure a third-party project using cmake 3.23
which requires FLEX, and I have both of them on my machine
and for some reason it doesn’t pick up where they are,
telling me that it couldn’t find flex executable.

here’s the error message:

CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find FLEX (missing: FLEX_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.23/Modules/FindFLEX.cmake:264 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:109 (find_package)

so I tried going through error source
and I couldn’t find where cmake points the directory for to pickup the executable,
docs didn’t help much either.
so I want to know where the hell cmake points the directory
or how would I change it’s directory without f**king this everything up.

I also face a similar issue when conifiguring for codeblocks
where I need to manually set it’s directory everytime
whenever I conifigure a project with codeblocks

Thank you.
Rellot’s screwdriver

Does the output from --debug-find help at all?

Without more context into where this flex binary actually exists, it’s hard to give support. Note that FindFLEX (and many other find modules) really only search “default” locations out of the box. For more custom setups (which is sadly common on Windows), CMake will need assistance. You can set FLEX_EXECUTABLE manually on the command line.

okay, so i tried doing --debug-find and it gave me a lot of paths that it expects to where flex executable should be.
I chose to put it in same directory where the cmake expects to have the executables and headers and it worked fine. Same with bison as some headers are used in flex.

The only problem I got is with iconv library… but i guess I’ll handle it from there. Thank you for helping and suggesting that command.

(if anyone’s curious, I’m trying to configure latest Doxygen version on my 32-bit machine, they only x64 bulids)