diff --git a/mathmech/CMakeLists.txt b/mathmech/CMakeLists.txt new file mode 100644 index 0000000..5c399bc --- /dev/null +++ b/mathmech/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required (VERSION 2.8) + +cmake_policy(SET CMP0003 OLD) +cmake_policy(SET CMP0011 NEW) +cmake_policy(SET CMP0015 NEW) + +# set project name +set (PROJECT mathmech) +# set additional cmake file +include (${PROJECT}.cmake) + + +# additional options +OPTION (WITH_DEBUG_MODE "Build with debug mode" OFF) +OPTION (ADD_INCLUDE "Add include files" OFF) + +# set libraries +set (LIBRARIES) + foreach (LIBRARY ${LIBRARIES}) + find_library ("${LIBRARY}_FOUND" ${LIBRARY}) + message (STATUS "Check the ${LIBRARY} is installed: " ${${LIBRARY}_FOUND}) + if ("${${LIBRARY}_FOUND}" STREQUAL "${LIBRARY}_FOUND-NOTFOUND") + message (STATUS "Adding library sources") + add_subdirectory (../${LIBRARY} lib/${LIBRARY}) + endif () + endforeach () + +# additional targets +set (TARGETS "") +set (HEADERS "") + +add_subdirectory (${${PROJECT}_SOURCE_DIR}) \ No newline at end of file diff --git a/mathmech/build/CMakeLists.txt b/mathmech/build/CMakeLists.txt deleted file mode 100644 index 4048a29..0000000 --- a/mathmech/build/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -cmake_minimum_required (VERSION 2.6) - -set (PROJECT mathmech) - -# additional options -OPTION (WITH_DEBUG_MODE "Build with debug mode" OFF) -OPTION (ADD_INCLUDE "Add include files" OFF) - -# executable path -set (EXECUTABLE_OUTPUT_PATH ${${PROJECT}_BINARY_DIR}) - -# verbose -set (CMAKE_VERBOSE_MAKEFILE ON) - -# flags -if ( WITH_DEBUG_MODE ) - add_definitions ( -DDEBUG_MODE=1 ) -endif () -if ( CMAKE_COMPILER_IS_GNUCXX ) - set (ADD_CXX_FLAGS "-Wall") - set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS_DEBUG "-g -O0") - set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") -elseif ( MSVC ) - set (ADD_CXX_FLAGS "/W4") - set (CMAKE_CXX_FLAGS "${ADD_CXX_FLAGS}") -else () - message ("Unknown compiler") -endif () - -# set directories -set (${PROJECT}_BINARY_DIR ../bin) -set (${PROJECT}_RESOURCE_DIR ../resources) -set (${PROJECT}_TRANSLATION_DIR ${${PROJECT}_RESOURCE_DIR}/translations) - -# set files -set (HEADERS - ../aboutwindow.h - ../aglallwindow.h - ../agglwindow.h - ../atomtypeswindow.h - ../clear_items.h - ../errorwindow.h - ../mainwindow.h - ../settingswindow.h - ../start_events.h - ../statgengraphwindow.h - ../update_fields.h) -set (SOURCES - ../aboutwindow.cpp - ../aglallwindow.cpp - ../agglwindow.cpp - ../atomtypeswindow.cpp - ../clear_items.cpp - ../errorwindow.cpp - ../main.cpp - ../mainwindow.cpp - ../settingswindow.cpp - ../start_events.cpp - ../statgengraphwindow.cpp - ../update_fields.cpp) -set (FORMS - ../aboutwindow.ui - ../agglwindow.ui - ../aglallwindow.ui - ../atomtypeswindow.ui - ../errorwindow.ui - ../mainwindow.ui - ../settingswindow.ui - ../statgengraphwindow.ui) -# set library -if (CMAKE_COMPILER_IS_GNUCXX) - set (LIBRARIES m) -else () - set (LIBRARIES) -endif() -set (LANGUAGES - eng - rus) -set (RESOURCES - ${${PROJECT}_RESOURCE_DIR}/resources.qrc) - - -# compile -project (${PROJECT}) -include_directories (../ - ${CMAKE_CURRENT_BINARY_DIR}) - -find_package (Qt4 REQUIRED) -include (${QT_USE_FILE}) -qt4_add_resources (QRC_SOURCES ${RESOURCES}) -qt4_wrap_cpp (MOC_SOURCES ${HEADERS}) -qt4_wrap_ui (UI_HEADERS ${FORMS}) -foreach (LANGUAGE ${LANGUAGES}) - set (TS ${${PROJECT}_TRANSLATION_DIR}/${LANGUAGE}.ts) - set (QM ${${PROJECT}_TRANSLATION_DIR}/${LANGUAGE}.qm) - set (TRANSLATIONS ${TRANSLATIONS} ${TS}) - set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM}) - add_custom_command ( - OUTPUT ${QM} - COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS} - MAIN_DEPENDENCY ${TS}) -endforeach() -add_custom_target ( - translations - COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} -ts ${TRANSLATIONS}) -add_custom_command ( - TARGET translations - COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS}) - -source_group ("Header Files" FILES ${HEADERS}) -source_group ("Source Files" FILES ${SOURCES}) -source_group ("Generated Files" FILES ${MOC_SOURCES}) -source_group ("Resource Files" FILES ${QRC_SOURCES}) - -add_executable (${PROJECT} WIN32 ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS}) - -target_link_libraries (${PROJECT} ${LIBRARIES} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) - -# install properties -INSTALL (TARGETS ${PROJECT} DESTINATION bin) diff --git a/mathmech/mathmech.cmake b/mathmech/mathmech.cmake new file mode 100644 index 0000000..dd834b0 --- /dev/null +++ b/mathmech/mathmech.cmake @@ -0,0 +1,31 @@ +# set directories +set (${PROJECT}_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set (${PROJECT}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) +set (${PROJECT}_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) +set (${PROJECT}_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib) +set (${PROJECT}_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources) +set (${PROJECT}_TRANSLATION_DIR ${${PROJECT}_RESOURCE_DIR}/translations) + +# library path +link_directories (${${PROJECT}_LIB_DIR}) +# executable path +set (EXECUTABLE_OUTPUT_PATH ${${PROJECT}_BINARY_DIR}) + +# verbose +set (CMAKE_VERBOSE_MAKEFILE ON) + +# flags +if ( WITH_DEBUG_MODE ) + add_definitions ( -DDEBUG_MODE=1 ) +endif () +if ( CMAKE_COMPILER_IS_GNUCXX ) + set (ADD_CXX_FLAGS "-Wall") + set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS_DEBUG "-g -O0") + set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") +elseif ( MSVC ) + set (ADD_CXX_FLAGS "/W4") + set (CMAKE_CXX_FLAGS "${ADD_CXX_FLAGS}") +else () + message ("Unknown compiler") +endif () \ No newline at end of file diff --git a/mathmech/resources/translations/eng.qm b/mathmech/resources/translations/eng.qm deleted file mode 100644 index be651ee..0000000 --- a/mathmech/resources/translations/eng.qm +++ /dev/null @@ -1 +0,0 @@ - AgglWindow - + Select file - + 'statgen' output files (*.dat);;All files (*.*) - + Save file as... - + Agglomerate files (*.agl);;All files (*.*) @@ -27,13 +27,13 @@ AglAll - - + + Processing 'agl'... - + Done @@ -41,27 +41,27 @@ AglAllWindow - + Select work directory - + Select trajectory file - + 'statgen' output files (*.dat);;All files (*.*) - + Save file as... - + PDB files (*.pdb);;All files (*.*) @@ -69,19 +69,19 @@ AtomTypesWindow - - - + + + Add new molecule - + Save file as... - + Atom types files (*.types);;All files (*.*) @@ -89,72 +89,72 @@ ErrorWindow - + Work directory does not exists - + Input file is not set - + Atoms in plane must be different - + Atom types file is not set - + Output file is not set - + Atom type must contain 2 characters - + Log file is not set - + Component is not found - + Atom types is not set - + Something wrong - + Interactions are not set - + Invalid file type - + Interaction step is not set - + Unknown error @@ -162,159 +162,159 @@ MainWindow - + Ready - - - - - + + + + + Select work directory - - - + + + Select trajectory file - + All files (*.*) - + Select atom types file - + Atom types files (*.types);;All files (*.*) - + Save files as - + Mask of trajectory files - - - - - + + + + + Save log file as... - - - - - + + + + + Log files (*.log) - - + + Select trajectory files - - - - + + + + Trajectory files (*.*[0-9]) - - + + Save output file as... - - + + Output files (*.dat) - - + + Save PDB file as... - - + + PDB files (*.pdb) - + Select agglomerate file - + Agglomerate files (*.agl);;All files (*.*) - - + + Processing 'trj'... - - - - - + + + + + Done - - + + Processing 'statgen'... - - + + Processing 'envir'... - - + + Processing 'radf'... - - + + Processing 'agl'... - - + + Processing 'trj2pdb'... @@ -322,22 +322,22 @@ SettingsWindow - - - - - - + + + + + + Select component - - - - - - + + + + + + All files (*) @@ -345,32 +345,32 @@ StatgenGraphWindow - + N - + p - + r - + g - + Save image as... - + JPEG file (*.jpeg);;Portable Network Graphics file (*.png);;Bitmap file (*.bmp) diff --git a/mathmech/resources/translations/rus.qm b/mathmech/resources/translations/rus.qm deleted file mode 100644 index be651ee..0000000 --- a/mathmech/resources/translations/rus.qm +++ /dev/null @@ -1 +0,0 @@ - - + AgglWindow - + Select file - + Выбор файла - + 'statgen' output files (*.dat);;All files (*.*) - + Файлы 'statgen' (*.dat);;Все файлы (*.*) - + Save file as... - + Сохранить файл как... - + Agglomerate files (*.agl);;All files (*.*) - + Файл с агломератом (*.agl);Все файлы (*.*) AglAll - - + + Processing 'agl'... - + Выполняется 'agl'... - + Done - + Готово AglAllWindow - + Select work directory - + Выбор рабочей директории - + Select trajectory file - + Выбор файла траектории - + 'statgen' output files (*.dat);;All files (*.*) - + Файлы 'statgen' (*.dat);;Все файлы (*.*) - + Save file as... - + Сохранить файл как... - + PDB files (*.pdb);;All files (*.*) - + PDB файлы (*.pdb);;Все файлы (*.*) AtomTypesWindow - - - + + + Add new molecule - + Добавить новую молекулу - + Save file as... - + Сохранить файл как... - + Atom types files (*.types);;All files (*.*) - + Файл типов атомов (*.types);;Все файлы (*.*) ErrorWindow - + Work directory does not exists - + Рабочая директория не существует - + Input file is not set - + Входной файл не задан - + Atoms in plane must be different - + Атомы, образующие плоскость, должны быть различными - + Atom types file is not set - + Типы атомов не заданы - + Output file is not set - + Выходной файл не задан - + Atom type must contain 2 characters - + Тип атома должен содержать 2 символа - + Log file is not set - + Лог файл не задан - + Component is not found - + Компонент не найден - + Atom types is not set - + Тип атома не задан - + Something wrong - + Что то не так - + Interactions are not set - + Взаимодействия не заданы - + Invalid file type - + Неправильный тип файла - + Interaction step is not set - + Шаг взаимодействия не задан - + Unknown error - + Неизвестная ошибка MainWindow - + Ready - + Готов - - - - - + + + + + Select work directory - + Выбор рабочей директории - - - + + + Select trajectory file - + Выбор файла траектории - + All files (*.*) - + Все файлы (*.*) - + Select atom types file - + Выбор файла типов атомов - + Atom types files (*.types);;All files (*.*) - + Файл типов атомов (*.types);;Все файлы (*.*) - + Save files as - + Сохранить файл как... - + Mask of trajectory files - + Маска файлов траектории - - - - - + + + + + Save log file as... - + Сохранить лог как... - - - - - + + + + + Log files (*.log) - + Лог (*.log) - - + + Select trajectory files - + Выбор файла траектории - - - - + + + + Trajectory files (*.*[0-9]) - + Файлы траектории (*.*[0-9]) - - + + Save output file as... - + Сохранить файл как... - - + + Output files (*.dat) - + Выходной файл (*.dat) - - + + Save PDB file as... - + Сохранить PDB как... - - + + PDB files (*.pdb) - + PDB файл (*.pdb) - + Select agglomerate file - + Выбор файла с агломератом - + Agglomerate files (*.agl);;All files (*.*) - + Файл с агломератом (*.agl);Все файлы (*.*) - - + + Processing 'trj'... - + Выполняется 'trj'... - - - - - + + + + + Done - + Готово - - + + Processing 'statgen'... - + Выполняется 'statgen'... - - + + Processing 'envir'... - + Выполняется 'envir'... - - + + Processing 'radf'... - + Выполняется 'radf'... - - + + Processing 'agl'... - + Выполняется 'agl'... - - + + Processing 'trj2pdb'... - + Выполняется 'trj2pdb'... SettingsWindow - - - - - - + + + + + + Select component - + Выбор компонента - - - - - - + + + + + + All files (*) - + Все файлы (*) StatgenGraphWindow - + N - + N - + p - + p - + r - + r - + g - + g - + Save image as... - + Сохранить изображение как... - + JPEG file (*.jpeg);;Portable Network Graphics file (*.png);;Bitmap file (*.bmp) - + JPEG (*.jpeg);;Portable Network Graphics (*.png);;Bitmap (*.bmp) diff --git a/mathmech/src/CMakeLists.txt b/mathmech/src/CMakeLists.txt new file mode 100644 index 0000000..ff0b658 --- /dev/null +++ b/mathmech/src/CMakeLists.txt @@ -0,0 +1,67 @@ +set ("${PROJECT}_VERSION_MAJOR" 1) +set ("${PROJECT}_VERSION_MINOR" 0) +set ("${PROJECT}_VERSION_PATCH" 0) +set ("${PROJECT}_VERSION" ${${PROJECT}_VERSION_MAJOR}.${${PROJECT}_VERSION_MINOR}.${${PROJECT}_VERSION_PATCH}) + +message (STATUS "${PROJECT}: Version ${${PROJECT}_VERSION}") + +# set files +file (GLOB SOURCES *.cpp) +file (GLOB HEADERS *.h) +file (GLOB FORMS *.ui) +# set library +if (CMAKE_COMPILER_IS_GNUCXX) + set (LIBRARIES m) +else () + set (LIBRARIES) +endif() +set (LANGUAGES + eng + rus) +set (RESOURCES ${${PROJECT}_RESOURCE_DIR}/resources.qrc) + +message (STATUS "SOURCES: ${SOURCES}") +message (STATUS "HEADERS: ${HEADERS}") +message (STATUS "FORMS: ${FORMS}") + + +# compile +project (${PROJECT}) +# include_path +include_directories (${${PROJECT}_INCLUDE_DIR}/${PROJECT} + ${${PROJECT}_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}) + +find_package (Qt4 REQUIRED) +include (${QT_USE_FILE}) +qt4_add_resources (QRC_SOURCES ${RESOURCES}) +qt4_wrap_cpp (MOC_SOURCES ${HEADERS}) +qt4_wrap_ui (UI_HEADERS ${FORMS}) +foreach (LANGUAGE ${LANGUAGES}) + set (TS ${${PROJECT}_TRANSLATION_DIR}/${LANGUAGE}.ts) + set (QM ${${PROJECT}_TRANSLATION_DIR}/${LANGUAGE}.qm) + set (TRANSLATIONS ${TRANSLATIONS} ${TS}) + set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM}) + add_custom_command ( + OUTPUT ${QM} + COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS} + MAIN_DEPENDENCY ${TS}) +endforeach() +add_custom_target ( + translations + COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} -ts ${TRANSLATIONS}) +add_custom_command ( + TARGET translations + COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS}) + +source_group ("Header Files" FILES ${HEADERS}) +source_group ("Source Files" FILES ${SOURCES}) +source_group ("Generated Files" FILES ${MOC_SOURCES}) +source_group ("Resource Files" FILES ${QRC_SOURCES}) + +add_executable (${PROJECT} WIN32 ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS}) + +target_link_libraries (${PROJECT} ${LIBRARIES} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) + +# install properties +INSTALL (TARGETS ${PROJECT} DESTINATION bin) diff --git a/mathmech/Makefile b/mathmech/src/Makefile similarity index 100% rename from mathmech/Makefile rename to mathmech/src/Makefile diff --git a/mathmech/aboutwindow.cpp b/mathmech/src/aboutwindow.cpp similarity index 100% rename from mathmech/aboutwindow.cpp rename to mathmech/src/aboutwindow.cpp diff --git a/mathmech/aboutwindow.h b/mathmech/src/aboutwindow.h similarity index 100% rename from mathmech/aboutwindow.h rename to mathmech/src/aboutwindow.h diff --git a/mathmech/aboutwindow.ui b/mathmech/src/aboutwindow.ui similarity index 100% rename from mathmech/aboutwindow.ui rename to mathmech/src/aboutwindow.ui diff --git a/mathmech/agglwindow.cpp b/mathmech/src/agglwindow.cpp similarity index 100% rename from mathmech/agglwindow.cpp rename to mathmech/src/agglwindow.cpp diff --git a/mathmech/agglwindow.h b/mathmech/src/agglwindow.h similarity index 100% rename from mathmech/agglwindow.h rename to mathmech/src/agglwindow.h diff --git a/mathmech/agglwindow.ui b/mathmech/src/agglwindow.ui similarity index 100% rename from mathmech/agglwindow.ui rename to mathmech/src/agglwindow.ui diff --git a/mathmech/aglallwindow.cpp b/mathmech/src/aglallwindow.cpp similarity index 100% rename from mathmech/aglallwindow.cpp rename to mathmech/src/aglallwindow.cpp diff --git a/mathmech/aglallwindow.h b/mathmech/src/aglallwindow.h similarity index 100% rename from mathmech/aglallwindow.h rename to mathmech/src/aglallwindow.h diff --git a/mathmech/aglallwindow.ui b/mathmech/src/aglallwindow.ui similarity index 100% rename from mathmech/aglallwindow.ui rename to mathmech/src/aglallwindow.ui diff --git a/mathmech/atomtypeswindow.cpp b/mathmech/src/atomtypeswindow.cpp similarity index 100% rename from mathmech/atomtypeswindow.cpp rename to mathmech/src/atomtypeswindow.cpp diff --git a/mathmech/atomtypeswindow.h b/mathmech/src/atomtypeswindow.h similarity index 100% rename from mathmech/atomtypeswindow.h rename to mathmech/src/atomtypeswindow.h diff --git a/mathmech/atomtypeswindow.ui b/mathmech/src/atomtypeswindow.ui similarity index 100% rename from mathmech/atomtypeswindow.ui rename to mathmech/src/atomtypeswindow.ui diff --git a/mathmech/clear_items.cpp b/mathmech/src/clear_items.cpp similarity index 100% rename from mathmech/clear_items.cpp rename to mathmech/src/clear_items.cpp diff --git a/mathmech/clear_items.h b/mathmech/src/clear_items.h similarity index 100% rename from mathmech/clear_items.h rename to mathmech/src/clear_items.h diff --git a/mathmech/errorwindow.cpp b/mathmech/src/errorwindow.cpp similarity index 100% rename from mathmech/errorwindow.cpp rename to mathmech/src/errorwindow.cpp diff --git a/mathmech/errorwindow.h b/mathmech/src/errorwindow.h similarity index 100% rename from mathmech/errorwindow.h rename to mathmech/src/errorwindow.h diff --git a/mathmech/errorwindow.ui b/mathmech/src/errorwindow.ui similarity index 100% rename from mathmech/errorwindow.ui rename to mathmech/src/errorwindow.ui diff --git a/mathmech/main.cpp b/mathmech/src/main.cpp similarity index 100% rename from mathmech/main.cpp rename to mathmech/src/main.cpp diff --git a/mathmech/mainwindow.cpp b/mathmech/src/mainwindow.cpp similarity index 100% rename from mathmech/mainwindow.cpp rename to mathmech/src/mainwindow.cpp diff --git a/mathmech/mainwindow.h b/mathmech/src/mainwindow.h similarity index 100% rename from mathmech/mainwindow.h rename to mathmech/src/mainwindow.h diff --git a/mathmech/mainwindow.ui b/mathmech/src/mainwindow.ui similarity index 100% rename from mathmech/mainwindow.ui rename to mathmech/src/mainwindow.ui diff --git a/mathmech/mathmech.pro b/mathmech/src/mathmech.pro similarity index 100% rename from mathmech/mathmech.pro rename to mathmech/src/mathmech.pro diff --git a/mathmech/mathmech.pro.user b/mathmech/src/mathmech.pro.user similarity index 100% rename from mathmech/mathmech.pro.user rename to mathmech/src/mathmech.pro.user diff --git a/mathmech/settingswindow.cpp b/mathmech/src/settingswindow.cpp similarity index 100% rename from mathmech/settingswindow.cpp rename to mathmech/src/settingswindow.cpp diff --git a/mathmech/settingswindow.h b/mathmech/src/settingswindow.h similarity index 100% rename from mathmech/settingswindow.h rename to mathmech/src/settingswindow.h diff --git a/mathmech/settingswindow.ui b/mathmech/src/settingswindow.ui similarity index 100% rename from mathmech/settingswindow.ui rename to mathmech/src/settingswindow.ui diff --git a/mathmech/start_events.cpp b/mathmech/src/start_events.cpp similarity index 100% rename from mathmech/start_events.cpp rename to mathmech/src/start_events.cpp diff --git a/mathmech/start_events.h b/mathmech/src/start_events.h similarity index 100% rename from mathmech/start_events.h rename to mathmech/src/start_events.h diff --git a/mathmech/statgengraphwindow.cpp b/mathmech/src/statgengraphwindow.cpp similarity index 100% rename from mathmech/statgengraphwindow.cpp rename to mathmech/src/statgengraphwindow.cpp diff --git a/mathmech/statgengraphwindow.h b/mathmech/src/statgengraphwindow.h similarity index 100% rename from mathmech/statgengraphwindow.h rename to mathmech/src/statgengraphwindow.h diff --git a/mathmech/statgengraphwindow.ui b/mathmech/src/statgengraphwindow.ui similarity index 100% rename from mathmech/statgengraphwindow.ui rename to mathmech/src/statgengraphwindow.ui diff --git a/mathmech/update_fields.cpp b/mathmech/src/update_fields.cpp similarity index 100% rename from mathmech/update_fields.cpp rename to mathmech/src/update_fields.cpp diff --git a/mathmech/update_fields.h b/mathmech/src/update_fields.h similarity index 100% rename from mathmech/update_fields.h rename to mathmech/src/update_fields.h