Unknown command line option '-prefix' building Qt6.2 on Windows
Solved
Installation and Deployment
-
In case this is useful to anyone:
I am trying to build the latest release of Qt 6.2 on Windows.
Yesterday I solved a problem where configure would abort with the error
Unknown command line option '-prefix'.
I fixed it by upgrading CMake to the latest release (3.25.1 at the time of writing) and ensuring the CMake folder appeared at the top of my PATH ahead of an older version installed through Cygwin.
Qt configure searches the source tree for files matching qt_cmdline.cmake (qtbase/cmake/QtProcessConfigureArgs.cmake). Modules register their command line options by calling various qt_commandline_* functions in this file. In this case the line:
file(GLOB commandline_files "${MODULE_ROOT}/*/${commandline_filename}")
to find all the qt_cmdline.cmake files was returning no matches.