-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathinstall_dconfig.cmake
More file actions
34 lines (32 loc) · 1.38 KB
/
install_dconfig.cmake
File metadata and controls
34 lines (32 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0
# expect that all dconfigs of plugin is saved in ./assets/configs
function(INSTALL_DCONFIG CONFIG_NAME)
set(DConfigPath ${CMAKE_SOURCE_DIR}/assets/configs)
message("DConfigPath: ${DConfigPath}")
set(AppId "deepin-ocr")
set(ConfigName ${CONFIG_NAME})
if (DEFINED DSG_DATA_DIR)
message("-- DConfig is supported by DTK")
message("---- AppId: ${AppId}")
message("---- Base: ${DConfigPath}")
message("---- Files: ${DConfigPath}/${ConfigName}")
if(COMMAND dtk_add_config_meta_files)
message(STATUS "Using dtk_add_config_meta_files")
dtk_add_config_meta_files(APPID ${AppId}
BASE ${DConfigPath}
FILES ${DConfigPath}/${ConfigName})
else()
message(STATUS "Using dconfig_meta_files")
dconfig_meta_files(APPID ${AppId}
BASE ${DConfigPath}
FILES ${DConfigPath}/${ConfigName})
endif()
else()
set(DSG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/dsg)
message("-- DConfig is NOT supported by DTK, install files into target path")
message("---- InstallTargetDir: ${DSG_DATA_DIR}/configs")
install(FILES ${DConfigPath}/${ConfigName} DESTINATION ${DSG_DATA_DIR}/configs/${AppId})
endif()
endfunction()