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 kvačica. Morate instalirati alat i reći Qt Creator gdje ste ga instalirali.
Za automatsko formatiranje CMake datoteka pri spremanju:
- Odaberite Preferences > CMake > Formatter.

- U odjeljku CMakeFormat command unesite putanju do
cmake-format.exe. - Odaberite Automatic formatting on file save da biste automatski formatirali CMake datoteke prilikom spremanja.
Za privremeno onemogućavanje ove postavke tijekom spremanja datoteke idite na File i odaberite Save Without Formatting.
U odjeljku xml-ph-0000@deepl.internal dodajte MIME tipove datoteka koje želite formatirati, odvojene - U Restrict to MIME types dodajte MIME tipove datoteka za formatiranje, 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 kako 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.