mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update build scripts
This commit is contained in:
parent
26fb792bf2
commit
a7185aa0cb
@ -1,72 +1 @@
|
|||||||
function(sak_add_lupdate)
|
# Nothing
|
||||||
set(LUPDATE "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin/lupdate.exe")
|
|
||||||
set(LRELEASE "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin/lrelease.exe")
|
|
||||||
|
|
||||||
# Create ts file.
|
|
||||||
set(COMMON_STR ${LUPDATE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts)
|
|
||||||
add_custom_target(
|
|
||||||
sak_lupdate
|
|
||||||
COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_en.ts
|
|
||||||
COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_zh_CN.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_ar.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_cs.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_da.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_de.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_es.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_fa.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_fi.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_fr.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_he.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_uk.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_it.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_ja.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_ko.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_lt.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_pl.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_pt.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_ru.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_sk.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_sl.ts
|
|
||||||
# COMMAND ${COMMON_STR} ${CMAKE_SOURCE_DIR}/resources/translations/sak_sv.ts
|
|
||||||
SOURCES .cmake/sak_i18n.cmake
|
|
||||||
VERBATIM)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(sak_add_lrelease)
|
|
||||||
# Create qm file.
|
|
||||||
add_custom_target(
|
|
||||||
sak_lrelease
|
|
||||||
COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_en.ts
|
|
||||||
COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_zh_CN.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_ar.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_cs.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_da.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_de.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_es.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_fa.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_fi.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_fr.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_he.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_uk.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_it.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_ja.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_ko.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_lt.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_pl.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_pt.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_ru.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_sk.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_sl.ts
|
|
||||||
# COMMAND ${LRELEASE} -compress ${CMAKE_SOURCE_DIR}/resources/translations/sak_sv.ts
|
|
||||||
SOURCES .cmake/sak_i18n.cmake
|
|
||||||
VERBATIM)
|
|
||||||
|
|
||||||
add_dependencies(sak_lrelease sak_lupdate)
|
|
||||||
|
|
||||||
# Auto create ts files and qm files.
|
|
||||||
option(SAK_AUTO_I18N "" OFF)
|
|
||||||
if(SAK_AUTO_I18N)
|
|
||||||
add_custom_target(sak_i18n ALL)
|
|
||||||
add_dependencies(sak_i18n sak_lrelease)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|||||||
@ -57,9 +57,6 @@ sak_git_get_last_tag(${CMAKE_CURRENT_SOURCE_DIR} "SAK")
|
|||||||
# Assistant module.
|
# Assistant module.
|
||||||
include_directories(src/assistants)
|
include_directories(src/assistants)
|
||||||
include_directories(src/assistantsui)
|
include_directories(src/assistantsui)
|
||||||
include(${CMAKE_SOURCE_DIR}/.cmake/sak_i18n.cmake)
|
|
||||||
sak_add_lupdate()
|
|
||||||
sak_add_lrelease()
|
|
||||||
|
|
||||||
# Glog module.
|
# Glog module.
|
||||||
option(SAK_USING_GLOG "Using glog module." ON)
|
option(SAK_USING_GLOG "Using glog module." ON)
|
||||||
@ -204,6 +201,8 @@ if(SAK_IMPORT_MODULE_BLUETOOTH)
|
|||||||
target_link_libraries(QtSwissArmyKnife PRIVATE Qt${QT_VERSION_MAJOR}::Bluetooth)
|
target_link_libraries(QtSwissArmyKnife PRIVATE Qt${QT_VERSION_MAJOR}::Bluetooth)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(resources/translations)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS QtSwissArmyKnife
|
TARGETS QtSwissArmyKnife
|
||||||
BUNDLE DESTINATION .
|
BUNDLE DESTINATION .
|
||||||
@ -233,7 +232,8 @@ endif()
|
|||||||
# The private module is not open source.
|
# The private module is not open source.
|
||||||
option(SAK_ENABLE_APP_PRIVATE "Do not change the option unless you are the author" OFF)
|
option(SAK_ENABLE_APP_PRIVATE "Do not change the option unless you are the author" OFF)
|
||||||
if(SAK_ENABLE_APP_PRIVATE)
|
if(SAK_ENABLE_APP_PRIVATE)
|
||||||
|
sak_add_subdirectory("nodeeditor-3.0.10")
|
||||||
if(NOT Qt6_VERSION VERSION_LESS "6.5.0")
|
if(NOT Qt6_VERSION VERSION_LESS "6.5.0")
|
||||||
include(${CMAKE_SOURCE_DIR}/src/private/private.cmake)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/src/private)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
include(.cmake/sak_common.cmake)
|
include(${CMAKE_SOURCE_DIR}/.cmake/sak_common.cmake)
|
||||||
|
|
||||||
file(
|
file(
|
||||||
GLOB dirs
|
GLOB dirs
|
||||||
LIST_DIRECTORIES true
|
LIST_DIRECTORIES true
|
||||||
"${CMAKE_SOURCE_DIR}/src/private/*")
|
"${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||||
list(REMOVE_ITEM dirs "common")
|
list(REMOVE_ITEM dirs "common")
|
||||||
set(SAK_HAS_PRIVATE_MODULE false)
|
set(SAK_HAS_PRIVATE_MODULE false)
|
||||||
|
|
||||||
@ -15,17 +15,10 @@ foreach(dir ${dirs})
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(${SAK_HAS_PRIVATE_MODULE})
|
|
||||||
sak_add_subdirectory("nodeeditor-3.0.10")
|
|
||||||
add_compile_definitions(SAK_IMPORT_MODULE_PRIVATE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(dir ${dirs})
|
foreach(dir ${dirs})
|
||||||
if(IS_DIRECTORY ${dir})
|
if(IS_DIRECTORY ${dir})
|
||||||
file(RELATIVE_PATH cooked_dir ${CMAKE_SOURCE_DIR} ${dir})
|
file(RELATIVE_PATH cooked_dir ${CMAKE_SOURCE_DIR} ${dir})
|
||||||
if(NOT ${cooked_dir} STREQUAL "src/private/common")
|
add_subdirectory(${CMAKE_SOURCE_DIR}/${cooked_dir})
|
||||||
add_subdirectory(${cooked_dir})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@ -34,5 +27,4 @@ add_custom_target(
|
|||||||
COMMAND git clone https://gitee.com/qsaker-qsak/fluent2.git ./fluent2
|
COMMAND git clone https://gitee.com/qsaker-qsak/fluent2.git ./fluent2
|
||||||
COMMAND git clone https://gitee.com/qsaker-qsak/easydebug.git ./easydebug
|
COMMAND git clone https://gitee.com/qsaker-qsak/easydebug.git ./easydebug
|
||||||
COMMAND git clone https://gitee.com/qsaker-qsak/dataflowstudio.git ./dataflowstudio
|
COMMAND git clone https://gitee.com/qsaker-qsak/dataflowstudio.git ./dataflowstudio
|
||||||
SOURCES ${CMAKE_SOURCE_DIR}/src/private/private.cmake
|
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/private)
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/private)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user