FET Forum

FET Development => Suggestions => Topic started by: gradgrind on January 15, 2026, 11:44:44 AM

Title: CMake
Post by: gradgrind on January 15, 2026, 11:44:44 AM
Hello Liviu,

I wanted to send this to your mail address, but it refused to accept it.

I have been trying to make the CMake files for FET produce results like your binary packages directly, picking up the version automatically from a VERSION file. Maybe this can simplify the build process?

I also wanted to make it easy to build just the command-line version, and of course (for fetrunner) to build the command-line binary without console window (fet-clw) on Windows.

There may be better ways of doing it, but I now have something that has been working well in my tests so far (I can't test MacOS). The modifications are attached.

There is (I think) just one change from your Windows package: I have put the Qt plugins in their own directory. It seemed neater to me.


I have been using the following build commands, always from a "build" directory in the FET root directory.


Linux, to configure, full build:

$HOME/Qt/Tools/CMake/bin/cmake .. -DCMAKE_PREFIX_PATH=$HOME/Qt/6.10.1/gcc_64 -DCMAKE_INSTALL_PREFIX=
The empty CMAKE_INSTALL_PREFIX causes the install directory to be named fet-x.y.z, where x.y.z is the version from the VERSION file.

Linux, to configure, cl-only:

$HOME/Qt/Tools/CMake/bin/cmake .. -DCMAKE_PREFIX_PATH=$HOME/Qt/6.10.1/gcc_64 -DCMAKE_INSTALL_PREFIX= -DCL_ONLY=on

Linux, to build and install:

$HOME/Qt/Tools/CMake/bin/cmake --build . --target install -j 4

Windows, to configure, full build:

C:\Qt\Tools\CMake_64\bin\cmake.exe .. -DCMAKE_PREFIX_PATH=C:\Qt\6.10.1\mingw_64 -DCMAKE_GENERATOR="MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=
Windows, to configure, cl-only:

C:\Qt\Tools\CMake_64\bin\cmake.exe .. -DCMAKE_PREFIX_PATH=C:\Qt\6.10.1\mingw_64 -DCMAKE_GENERATOR="MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=install -DCL_ONLY=on
Windows, to configure for fet-clw:

C:\Qt\Tools\CMake_64\bin\cmake.exe .. -DCMAKE_PREFIX_PATH=C:\Qt\6.10.1\mingw_64 -DCMAKE_GENERATOR="MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=install -DCL_ONLY=on -DNO_WIN_CONSOLE=on

Windows, to build and install:

C:\Qt\Tools\CMake_64\bin\cmake.exe --build . --target install -j 4

What do you think?

Title: Re: CMake
Post by: Liviu Lalescu on January 15, 2026, 01:19:20 PM
Hello, Michael,

Indeed, my server rejects gz files.

We'll probably adapt your new file, but I need Volker's approval.

I prefer to compile on GNU/Linux using ~/Qt/6.10.1/bin/qt-cmake.

On Windows, I don't use cmake --install, so I'll probably use your new changes.

Probably we'll release a new FET version with Qt 6.10.2, scheduled in a week from now.

I might put a snapshot for you to test. I'll let you know in this case.

PS: I think you could have sent me an email with the CMakeLists unarchived. I prefer to work by email, so please resend that way if possible.

Edited: I attach some cosmetic modifications on your files, by me. Please use my attached files. I don't understand everything in your files, but I'll try in the next interval.

Please use four spaces, not a tab, for indent, it seems CMake standard. Edit my attached files (basically yours) for this.
Title: Re: CMake
Post by: Liviu Lalescu on January 15, 2026, 04:02:20 PM
Also, Michael, I saw you modified the translations section. I think I would prefer fet_ro.ts and .qm, as now, and keep always translating the whole FET, so that I am sure not to mistake and remove some translations fields. Could you revert/update this, or let me know more about what you did?
Title: Re: CMake
Post by: gradgrind on January 15, 2026, 05:04:55 PM
Hmmm ... I didn't think of that problem with the translations ... indeed, lupdate should only be done on the full build.

I'll need a bit of time to consider that one!
Title: Re: CMake
Post by: Liviu Lalescu on January 15, 2026, 05:06:10 PM
OK, Michael, I'll wait for your signal, thank you!
Title: Re: CMake
Post by: Volker Dirr on January 15, 2026, 10:05:46 PM
hmm... I am bad at cmake, but CL_ONLY is not defined. I know that not defined values are set/transferred to "false".

But if i understood cmake correct, then best practice is to define CL_ONLY (in the main cmake file) with something like:

option(CL_ONLY "Build the command line version only" OFF)
Title: Re: CMake
Post by: Liviu Lalescu on January 16, 2026, 11:49:23 AM
OK, Volker, thank you! We forgot about this. I added these in the latest snapshot: https://lalescu.ro/liviu/Backup-fet/