프로젝트 설정 공유
Qt Creator 는 사용자별 프로젝트 설정을 프로젝트 디렉터리 아래 .qtcreator/ 디렉터리에 있는 .user 파일에 저장합니다. 이러한 설정을 .shared 파일(예: CMakeLists.txt.shared, qtcreator.pro.shared, 또는 qtcreator.qbs.shared)로 여러 프로젝트 간에 공유할 수 있습니다. 이 파일은 .user 파일과 동일한 XML 구조를 가지지만 공유할 설정만 있습니다.
CMake 프로젝트 설정을 공유하려면 CMake 프리셋 또는 CMakeLists.txt.shared 파일을 사용합니다.
공유 설정 파일 만들기
.shared 파일을 만드는 가장 쉬운 방법은 .user 파일에서 설정을 복사하는 것입니다. 일반적으로 ProjectExplorer.Project.EditorSettings 섹션의 일부 값을 공유합니다.
참고: 항상 ProjectExplorer.Project.Updater.FileVersion 변수를 지정하고 .user 파일에서와 동일한 값을 사용해야 합니다.
그런 다음 .shared 파일을 다른 개발자에게 전달하거나 다른 개발 PC에 복사할 수 있습니다.
다음은 .shared 파일의 예입니다:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> <qtcreator> <data> <variable>ProjectExplorer.Project.EditorSettings</variable> <valuemap type="QVariantMap"> <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> <value type="int" key="EditorConfiguration.TabSize">14</value> <value type="int" key="EditorConfiguration.IndentSize">4</value> </valuemap> </data> <data> <variable>ProjectExplorer.Project.Updater.FileVersion</variable> <value type="int">10</value> </data> </qtcreator>
공유 설정 업데이트
공유 설정을 추가한 후 Qt Creator 프로젝트를 처음 로드하면 사용자 설정을 해당 설정으로 덮어씁니다. 프로젝트를 처음 열 때 Qt Creator 에서 .user 파일을 만들지 않은 경우 .shared 파일의 설정이 즉시 적용됩니다.
.shared 파일을 받았는데 그 안에 있는 특정 설정을 사용하지 않으려는 경우 Qt Creator 을 통해 변경할 수 있습니다. 다음에 프로젝트를 열면 설정이 업데이트되지 않습니다. Qt Creator .user 파일에서 고정 설정을 추적하고 사용자 파일과 공유 파일의 값이 결국 동일해지면 표시를 제거합니다. 이는 단지 무언가를 시험해보고 싶어서 만든 영구적인 고정 설정을 피하기 위한 것입니다.
CMake 프로젝트 설정 공유
다음은 CMakeLists.txt.shared 파일의 예입니다:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="CMakeSpecificSettings">
<value type="bool" key="AskBeforePresetsReload">false</value>
<value type="bool" key="AskReConfigureInitialParams">false</value>
<value type="bool" key="AutorunCMake">false</value>
<value type="bool" key="PackageManagerAutoSetup">false</value>
<value type="bool" key="ShowAdvancedOptionsByDefault">true</value>
<value type="bool" key="ShowSourceSubFolders">false</value>
<value type="bool" key="UseGlobalSettings">false</value>
<value type="bool" key="UseJunctionsForSourceAndBuildDirectories">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>설정에 대한 자세한 내용은 프로젝트에 대한 CMake 설정 재정의하기를 참조하세요.
프로젝트 구성 및 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.