CMake ts fix 5
This commit is contained in:
@@ -39,26 +39,18 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM TRUE)
|
|||||||
set(TS_FILES
|
set(TS_FILES
|
||||||
./src/translations/en_US.ts
|
./src/translations/en_US.ts
|
||||||
./src/translations/zh_CN.ts)
|
./src/translations/zh_CN.ts)
|
||||||
find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
|
|
||||||
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
|
||||||
set(TS_FILES
|
|
||||||
src/translations/en_US.ts
|
|
||||||
src/translations/zh_CN.ts)
|
|
||||||
foreach(_file ${TS_FILES})
|
foreach(_file ${TS_FILES})
|
||||||
set(backup ${CMAKE_CURRENT_SOURCE_DIR}/${_file}.bak)
|
set(backup ${CMAKE_CURRENT_SOURCE_DIR}/${_file}.bak)
|
||||||
if(NOT EXISTS ${backup})
|
if(NOT EXISTS ${backup})
|
||||||
file( WRITE ${backup} "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE TS><TS version=\"2.1\" language=\"zh_CN\"><context></context></TS>")
|
file( WRITE ${backup} "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE TS><TS version=\"2.1\" language=\"zh_CN\"><context></context></TS>")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
|
find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
|
||||||
set(cpp_source_all ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} )
|
set(cpp_source_all ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} )
|
||||||
|
|
||||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_SOURCE_DIR}/src/translations)
|
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_SOURCE_DIR}/src/translations)
|
||||||
qt5_create_translation(QM_FILES ${cpp_source_all} ${ui_FILES} ${TS_FILES})
|
qt5_create_translation(QM_FILES ${cpp_source_all} ${ui_FILES} ${TS_FILES})
|
||||||
|
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} ${QM_FILES} )
|
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} ${QM_FILES} )
|
||||||
|
|
||||||
if(NOT UNIX)
|
if(NOT UNIX)
|
||||||
find_program(POWERSHELL_PATH NAMES powershell)
|
find_program(POWERSHELL_PATH NAMES powershell)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user