Skip to content

Commit d1b1eab

Browse files
committed
chore: eliminate CMake configuration warnings
The changes address CMake configuration warnings by: 1. Setting QTP0001 policy to NEW globally in the main CMakeLists.txt instead of setting it to OLD in individual modules 2. Adding POST_BUILD to custom command in packaging macro to ensure proper build timing 3. Removing redundant find_package calls for DdeControlCenter that were unnecessary 4. Removing duplicate QTP0001 policy settings from dock and tray modules These changes eliminate build warnings while maintaining the same functionality, making the build output cleaner and more professional. Influence: 1. Verify that the project builds without CMake warnings 2. Test that all modules still compile correctly 3. Ensure packaging functionality works as expected 4. Confirm that QML modules are properly generated 5. Test dock and tray functionality remains unchanged chore: 消除CMake配置警告 本次修改解决了CMake配置警告问题: 1. 在主CMakeLists.txt中全局设置QTP0001策略为NEW,而不是在各个模块中设置 为OLD 2. 在打包宏中添加POST_BUILD到自定义命令,确保正确的构建时机 3. 移除对DdeControlCenter的冗余find_package调用 4. 从dock和tray模块中移除重复的QTP0001策略设置 这些更改在保持相同功能的同时消除了构建警告,使构建输出更加清晰和专业。 Influence: 1. 验证项目构建时没有CMake警告 2. 测试所有模块仍能正确编译 3. 确保打包功能正常工作 4. 确认QML模块正确生成 5. 测试dock和tray功能保持不变
1 parent 6ce1b07 commit d1b1eab

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ find_package(ICU 74.2 REQUIRED COMPONENTS uc i18n io)
5858
find_package(WaylandProtocols REQUIRED)
5959
find_package(PkgConfig REQUIRED)
6060

61+
qt_policy(SET QTP0001 NEW)
62+
6163
try_compile(COMPILE_RESULT
6264
${CMAKE_CURRENT_BINARY_DIR}/try_compile_build
6365
SOURCES ${CMAKE_SOURCE_DIR}/tests/check/qt_wayland_keyextension.cpp

cmake/DDEShellPackageMacros.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ macro(ds_build_package)
1313
SOURCES ${package_files}
1414
)
1515
set(package_dirs ${PROJECT_BINARY_DIR}/packages/${_config_PACKAGE}/)
16-
add_custom_command(TARGET ${_config_PACKAGE}_package
16+
add_custom_command(TARGET ${_config_PACKAGE}_package POST_BUILD
1717
COMMAND ${CMAKE_COMMAND} -E copy_directory ${package_root_dir} ${package_dirs}
1818
)
1919

panels/dock/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ add_subdirectory(taskmanager)
9797
add_subdirectory(tray)
9898
add_subdirectory(multitaskview)
9999

100-
find_package(DdeControlCenter)
101-
102100
#add_subdirectory(appruntimeitem)
103101

104102
# dock qml element(include Dock.xx defines and DockCompositor)
@@ -127,7 +125,6 @@ set_source_files_properties(DockPalette.qml PROPERTIES
127125
QT_QML_SINGLETON_TYPE TRUE
128126
)
129127

130-
qt_policy(SET QTP0001 OLD)
131128
qt_add_qml_module(dock-plugin
132129
PLUGIN_TARGET dock-plugin
133130
URI "org.deepin.ds.dock"

panels/dock/tray/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Gu
88
find_package(Dtk6 REQUIRED COMPONENTS Core Gui)
99
find_package(DdeTrayLoader REQUIRED)
1010

11-
qt_policy(SET QTP0001 OLD)
1211
qt_add_qml_module(dock-tray
1312
PLUGIN_TARGET dock-tray
1413
URI "org.deepin.ds.dock.tray"

0 commit comments

Comments
 (0)