cmake4eclipse icon indicating copy to clipboard operation
cmake4eclipse copied to clipboard

cmake-presets support

Open ksrp1984 opened this issue 6 months ago • 4 comments

I created a CMakePresets.json file containing project configurations. I can see the list of available configurations by adding --list-presets to Other CMake arguments I can run a configuration by adding --preset MY_CONFIG_NAME But I can't run --build --presets and --workflow --presets.

Cmake4Eclipse adds first: -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_RULE_MESSAGES:BOOL=OFF -G "Unix Makefiles". Cmake throws an error. Cmake expects --workflow --presets to be the first argument.

The first step would be to add the ability to run cmake with its own parameters, without adding additional arguments. I think it's not difficult to implement.

The second step would be to load configurations from CMakePresets.json. This is more complicated. I'm not sure it's possible. But the first step would be enough. Configurations with --preset can be created manually.

CMakePresets.json is very useful when the project is distributed, and a user who does not use Eclipse can build it from the command line, or in another IDE supporting Cmake (VS, QTCreator...)

ksrp1984 avatar Aug 07 '24 14:08 ksrp1984