-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (28 loc) · 1022 Bytes
/
CMakeLists.txt
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
35
36
37
cmake_minimum_required(VERSION 3.5)
project(ms2od VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(UPDATE_TRANSLATIONS "Enable rescanning sources to update .ts files" OFF)
set(LANG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/lang)
set(BCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.bck)
file(GLOB LANG_FILES ${LANG_DIR}/*.ts)
file(GLOB LANG_FILES_BCK ${BCK_DIR}/*.ts)
if(EXISTS "${LANG_FILES}")
message(STATUS "TS files exist: backing up...")
file(MAKE_DIRECTORY ${BCK_DIR})
file(COPY ${LANG_FILES} DESTINATION ${BCK_DIR})
else()
message(STATUS "TS files do not exist.")
if(EXISTS "${LANG_FILES_BCK}")
message(STATUS "Restoring TS files...")
file(COPY ${LANG_FILES_BCK} DESTINATION ${LANG_DIR})
else()
message(STATUS "Cannot restore TS files: skipping.")
endif()
endif()
add_subdirectory(doc)
add_subdirectory(src)