CMake 파일 형식 지정

cmake-format 도구와 로컬 .cmake-format, .py 또는 .json 설정 파일을 사용하여, 페ンス(fence) 쌍으로 감싸지 않은 CMake 파일 내의 모든 텍스트를 서식 지정할 수 있습니다. 이 도구를 설치하고 Qt Creator 에 설치 위치를 알려주어야 합니다.

파일 저장 시 CMake 파일의 서식을 자동으로 적용하려면:

  1. Preferences > CMake > Formatter 을 선택합니다.

    CMake 환경 설정의 ‘포맷터’ 탭

  2. ' CMakeFormat command'에서 ' cmake-format.exe'의 경로를 입력합니다.
  3. Automatic formatting on file save ’을 선택하면 파일을 저장할 때 CMake 파일이 자동으로 서식이 지정됩니다.

    파일을 저장하는 동안 이 설정을 일시적으로 비활성화하려면 ‘ File ’로 이동하여 ‘ Save Without Formatting ’를 선택하십시오.

  4. Restrict to MIME types 에서 서식 지정할 파일의 MIME 유형을 세미콜론으로 구분하여 추가합니다. 기본값인 text/x-cmake 는 CMake 파일의 서식을 지정합니다. 이 필드가 비어 있으면 모든 파일의 서식이 지정됩니다.
  5. Restrict to files contained in the current project 를 선택하면 현재 프로젝트에 속한 CMake 파일만 서식 지정됩니다.

관련 항목 : 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.