diff --git a/CMakeLists.txt b/CMakeLists.txt index 471c13b..7cb5fc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)