QTP0003
Qt 라이브러리를 만들 때 BUILD_SHARED_LIBS 값을 고려합니다.
이 정책은 Qt 6.7에 도입되었습니다. 이 정책은 qt_add_library, qt_add_plugin, qt_add_qml_module과 같이 Qt CMake API를 사용하여 생성되는 라이브러리의 기본 유형에 영향을 줍니다.
정책이 OLD
로 설정된 경우 , 선택되는 기본 라이브러리 유형은 shared
또는 static
와 같은 Qt 빌드 유형에 맞춰집니다 .
정책이 NEW
으로 설정된 경우 라이브러리 유형은 BUILD_SHARED_LIBS 값이 설정되어 있는 경우 이 값에 따라 선택됩니다. BUILD_SHARED_LIBS
이 설정되지 않은 경우 기본 라이브러리 유형은 Qt XML 빌드 유형으로 돌아갑니다.
예를 들어 다음 코드는 BUILD_SHARED_LIBS
이 ON
로 설정되어 있어도 MyLib
대상에 대한 기본 라이브러리 유형으로 Qt 빌드 유형을 사용합니다:
set(BUILD_SHARED_LIBS ON) ... qt6_add_library(MyLib sourcefile.h sourcefile.cpp)
qt_add_library 호출 전에 QTP0003을 NEW
로 설정하면 BUILD_SHARED_LIBS
이 라이브러리 기본 유형에 영향을 미치고 MyLib
이 공유 라이브러리가 됩니다.
set(BUILD_SHARED_LIBS ON) ... qt_policy(SET QTP0003 NEW) qt6_add_library(MyLib sourcefile.h sourcefile.cpp)
qt_policy, Qt CMake 정책 및 qt_add_library도참조하십시오 .
© 2025 The Qt Company Ltd. 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.