New cmake logic, suit ts update

This commit is contained in:
Krad
2021-12-22 17:15:04 +08:00
parent 73ce9910e8
commit 595632aef5

View File

@@ -35,9 +35,16 @@ file(GLOB project_uis ./src/*.ui)
qt5_wrap_ui(ui_FILES ${project_uis})
file(GLOB project_res ./src/*.qrc)
set(TS_FILES
./src/translations/en_US.ts
./src/translations/zh_CN.ts)
SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM TRUE)
find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
set(cpp_source_all ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} )
qt5_create_translation(QM_FILES ${cpp_source_all} ${TS_FILES})
add_executable(${PROJECT_NAME} ${cpp_source_all} ${ui_FILES} ${QM_FILES} )
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} )
if(UNIX AND USE_SHIMLIB)
link_directories(/usr/local/lib64)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)