Formatiranje CMake datoteka
Možete koristiti alat cmake-format i lokalne konfiguracijske datoteke .cmake-format, .py ili .json za formatiranje bilo kojeg teksta u CMake datotekama koji niste zaštićeni parom klammi. Morate instalirati alat i reći Qt Creator gdje ste ga instalirali.
Za automatsko formatiranje CMake datoteka pri spremanju:
- Odaberite Preferences > CMake > Formatter.

- U CMakeFormat command unesite putanju do
cmake-format.exe. - Odaberite Automatic formatting on file save za automatsko formatiranje CMake datoteka pri njihovom spremanju.
Za privremeno onemogućavanje ove postavke tijekom spremanja datoteke, idite na File i odaberite Save Without Formatting.
- U Restrict to MIME types dodajte MIME tipove datoteka koje želite formatirati, odvojene točkama i zarezima. Zadana vrijednost,
text/x-cmake, formatira CMake datoteke. Ako je polje prazno, formatiraju se sve datoteke. - Odaberite Restrict to files contained in the current project da biste formatirali samo CMake datoteke koje pripadaju trenutnom projektu.
Vidi također Kako: izraditi s CMakeom, uređivanje MIME tipova i CMake.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.