CMake 파일 포맷하기
cmake-format 도구와 로컬 .cmake-format, .py, 또는 .json 구성 파일을 사용하여 한 쌍의 펜스로 보호하지 않는 CMake 파일의 텍스트 서식을 지정할 수 있습니다. 이 도구를 설치하고 설치한 위치를 Qt Creator 에 알려야 합니다.
파일 저장 시 CMake 파일을 자동으로 포맷하려면 다음과 같이 하세요:
- 환경설정 > CMake > Formatter 을 선택합니다.

- CMakeFormat command 에
cmake-format.exe경로를 입력합니다. - 파일을 저장할 때 CMake 파일을 자동으로 포맷하려면 Automatic formatting on file save 을 선택합니다.
파일을 저장하는 동안 이 설정을 일시적으로 비활성화하려면 File 으로 이동하여 Save Without Formatting 을 선택합니다.
- Restrict to MIME types 에 포맷할 파일의 MIME 유형을 세미콜론으로 구분하여 추가합니다. 기본값인
text/x-cmake은 CMake 파일의 형식을 지정합니다. 필드가 비어 있으면 모든 파일의 포맷이 지정됩니다. - 현재 프로젝트에 속한 CMake 파일만 포맷하려면 Restrict to files contained in the current project 을 선택합니다.
방법: CMake로 빌드하기, MIME 유형 편집 및 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.