2022-06-02 16:31:24 +08:00
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
project(ukui-screensaver)
|
|
|
|
|
|
2023-11-15 10:01:40 +08:00
|
|
|
|
## 更新翻译字段
|
|
|
|
|
file(GLOB TS_FILES ./i18n_ts/*.ts)
|
2022-06-02 16:31:24 +08:00
|
|
|
|
add_custom_command(
|
2023-11-15 10:01:40 +08:00
|
|
|
|
OUTPUT ${TS_FILES}
|
|
|
|
|
COMMAND lupdate src/ screensaver/ -ts ${TS_FILES}
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
2022-06-02 16:31:24 +08:00
|
|
|
|
add_custom_target(
|
2023-11-15 10:01:40 +08:00
|
|
|
|
i18n_ts
|
|
|
|
|
DEPENDS ${TS_FILES}
|
|
|
|
|
)
|
|
|
|
|
|
2022-06-02 16:31:24 +08:00
|
|
|
|
add_compile_options(-fPIC)
|
|
|
|
|
|
|
|
|
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
2023-11-15 10:01:40 +08:00
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
set(CMAKE_AUTORCC ON)
|
2022-06-02 16:31:24 +08:00
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
set(CMAKE_INSTALL_PREFIX /usr)
|
|
|
|
|
|
|
|
|
|
set(Debug ON)
|
|
|
|
|
if(Debug)
|
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
add_subdirectory(i18n_ts)
|
|
|
|
|
add_subdirectory(data)
|
|
|
|
|
|
2023-11-15 10:01:40 +08:00
|
|
|
|
# 让主目标依赖翻译文件,这样才会执行i18n
|
|
|
|
|
add_dependencies(ukui-screensaver-dialog i18n)
|