38 lines
1.4 KiB
CMake
38 lines
1.4 KiB
CMake
install(DIRECTORY templates/
|
|
DESTINATION "${SOURCES_INSTALL_RPEFIX}/templates")
|
|
|
|
find_package(Qt5 COMPONENTS LinguistTools)
|
|
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
file(GLOB TS_FILES "translations/*.ts")
|
|
foreach(TS_FILE IN LISTS TS_FILES)
|
|
message(STATUS "process ts file: ${TS_FILE}")
|
|
find_program(LUPDATE_COMMAND NAMES lupdate lupdate-qt5 lupdate-qt4 lupdate-pro)
|
|
if (NOT LUPDATE_COMMAND)
|
|
message(FATAL_ERROR "lupdate command not found")
|
|
endif()
|
|
execute_process(COMMAND ${LUPDATE_COMMAND} "${CMAKE_SOURCE_DIR}/src/" -ts -no-obsolete
|
|
"${TS_FILE}"
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
OUTPUT_VARIABLE OUTPUT
|
|
ERROR_VARIABLE ERROR
|
|
RESULT_VARIABLE RES)
|
|
if (RES)
|
|
message(FATAL_ERROR "process ts file result : ${RES}, with error: ${ERROR}")
|
|
endif()
|
|
message(STATUS "${OUTPUT}")
|
|
execute_process(COMMAND lrelease ${TS_FILE})
|
|
endforeach()
|
|
endif()
|
|
|
|
file(GLOB QM_FILES "translations/*.qm")
|
|
install(FILES ${QM_FILES} DESTINATION "${SOURCES_INSTALL_RPEFIX}/translations")
|
|
|
|
# install tools
|
|
set(TOOL_INSTALL_PATH "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/${CMAKE_PROJECT_NAME}/tools/env")
|
|
message("tool install path: ${TOOL_INSTALL_PATH}")
|
|
file(GLOB TOOL_FILES "${CMAKE_SOURCE_DIR}/assets/tools/*.tar.gz")
|
|
message(STATUS "TOOL_FILES ${TOOL_FILES}")
|
|
install(FILES ${TOOL_FILES} DESTINATION ${TOOL_INSTALL_PATH})
|