diff --git a/.uncrustify.cfg b/.uncrustify.cfg index 7f4d603..3cf0d67 100644 --- a/.uncrustify.cfg +++ b/.uncrustify.cfg @@ -1570,7 +1570,7 @@ donot_indent_func_def_close_paren = false # true/false nl_collapse_empty_body = false # true/false # Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. -nl_assign_leave_one_liners = true # true/false +nl_assign_leave_one_liners = false # true/false # Don't split one-line braced statements inside a 'class xx { }' body. nl_class_leave_one_liners = true # true/false @@ -1656,7 +1656,7 @@ nl_after_square_assign = ignore # ignore/add/remove/force/not_defined # Add or remove newline between a function call's ')' and '{', as in # 'list_for_each(item, &list) { }'. -nl_fcall_brace = add # ignore/add/remove/force/not_defined +nl_fcall_brace = force # ignore/add/remove/force/not_defined # Add or remove newline between 'enum' and '{'. nl_enum_brace = force # ignore/add/remove/force/not_defined @@ -1680,17 +1680,17 @@ nl_struct_brace = force # ignore/add/remove/force/not_defined nl_union_brace = force # ignore/add/remove/force/not_defined # Add or remove newline between 'if' and '{'. -nl_if_brace = force # ignore/add/remove/force/not_defined +nl_if_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline between '}' and 'else'. -nl_brace_else = force # ignore/add/remove/force/not_defined +nl_brace_else = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'else if' and '{'. If set to ignore, # nl_if_brace is used instead. nl_elseif_brace = force # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and '{'. -nl_else_brace = force # ignore/add/remove/force/not_defined +nl_else_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and 'if'. nl_else_if = force # ignore/add/remove/force/not_defined @@ -1714,7 +1714,7 @@ nl_try_brace = ignore # ignore/add/remove/force/not_defined nl_getset_brace = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'for' and '{'. -nl_for_brace = add # ignore/add/remove/force/not_defined +nl_for_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline before the '{' of a 'catch' statement, as in # 'catch (decl) {'. @@ -1738,7 +1738,7 @@ nl_brace_square = ignore # ignore/add/remove/force/not_defined nl_brace_fparen = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'while' and '{'. -nl_while_brace = add # ignore/add/remove/force/not_defined +nl_while_brace = remove # ignore/add/remove/force/not_defined # (D) Add or remove newline between 'scope (x)' and '{'. nl_scope_brace = ignore # ignore/add/remove/force/not_defined @@ -1763,7 +1763,7 @@ nl_do_brace = ignore # ignore/add/remove/force/not_defined nl_brace_while = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'switch' and '{'. -nl_switch_brace = add # ignore/add/remove/force/not_defined +nl_switch_brace = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'synchronized' and '{'. nl_synchronized_brace = ignore # ignore/add/remove/force/not_defined @@ -1862,7 +1862,7 @@ nl_template_var = ignore # ignore/add/remove/force/not_defined nl_template_using = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'class' and '{'. -nl_class_brace = add # ignore/add/remove/force/not_defined +nl_class_brace = force # ignore/add/remove/force/not_defined # Add or remove newline before or after (depending on pos_class_comma, # may not be IGNORE) each',' in the base class list. @@ -2283,7 +2283,7 @@ nl_after_func_body_one_liner = 0 # unsigned number # of a function body. # # 0: No change (default). -nl_func_var_def_blk = 1 # unsigned number +nl_func_var_def_blk = 0 # unsigned number # The number of newlines before a block of typedefs. If nl_after_access_spec # is non-zero, that option takes precedence. @@ -2294,7 +2294,7 @@ nl_typedef_blk_start = 0 # unsigned number # The number of newlines after a block of typedefs. # # 0: No change (default). -nl_typedef_blk_end = 1 # unsigned number +nl_typedef_blk_end = 0 # unsigned number # The maximum number of consecutive newlines within a block of typedefs. # @@ -2306,7 +2306,7 @@ nl_typedef_blk_in = 0 # unsigned number # that option takes precedence. # # 0: No change (default). -nl_var_def_blk_start = 1 # unsigned number +nl_var_def_blk_start = 0 # unsigned number # The number of empty newlines after a block of variable definitions # not at the top of a function body. diff --git a/CMakeLists.txt b/CMakeLists.txt index 7384614..50a692a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,35 +5,52 @@ cmake_minimum_required(VERSION 3.6 FATAL_ERROR) cmake_policy(VERSION 3.6..3.7) # Название и версия проекта и используемые языки программирования -project(myx-example-qt5-console VERSION 0.4.0 LANGUAGES C CXX) +project(znk-results VERSION 0.4.0 LANGUAGES C CXX) # Рекомендуемый способ подключения MyxCMake include(cmake/myx_setup.cmake) # Поиск пакетов myx_find_required_packages( - Qt5 Core + PACKAGES Eigen3 + Qt5 Core Sql Qt5Private Core) +FetchContent_Add(myx-handy-paths + GIT_REPOSITORY git@gitlab.2:myx/libs/myx-handy-paths + GIT_PATH myx/libs/myx-handy-paths + GIT_REMOTE origin +) + +FetchContent_Add(myx-handy-yaml + GIT_REPOSITORY git@gitlab.2:myx/libs/myx-handy-yaml + GIT_PATH myx/libs/myx-handy-yaml + GIT_REMOTE origin +) + +FetchContent_Add(myx-qt-database + GIT_REPOSITORY git@gitlab.2:myx/libs/myx-qt-database + GIT_PATH myx/libs/myx-qt-database + GIT_REMOTE origin +) + + # Цель для создания исполняемого файла myx_add_executable(${PROJECT_NAME}) # Настройка свойств цели myx_target_setup(${PROJECT_NAME} + PACKAGES Eigen3 CPP ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/main.cpp + LINK_LIBRARIES myx-handy-paths myx-qt-database Eigen3::Eigen ) # Настройка Qt для цели myx_qt5_target_setup(${PROJECT_NAME} - COMPONENTS Core - PRIVATE Core) - -# Автоматически генерируемый файл с информацией о репозитории -myx_generate_git_info_header(${PROJECT_NAME} "git_info_p.hpp") - -# Автоматически генерируемый приватный заголовочный файл -myx_generate_private_config_header(${PROJECT_NAME} "config_p.hpp") + COMPONENTS Core Sql + PRIVATE Core +) # Форматирование исходных текстов с помощью uncrustify myx_uncrustify(${PROJECT_NAME}) diff --git a/cmake/myx/MyxCMakeConfigVersion.cmake b/cmake/myx/MyxCMakeConfigVersion.cmake index 4d3862c..7e386cb 100644 --- a/cmake/myx/MyxCMakeConfigVersion.cmake +++ b/cmake/myx/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.0.32") +set(MYX_CMAKE_PACKAGE_VERSION "2.0.33") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/cmake/myx/lib/uncrustify/Uncrustify.cmake b/cmake/myx/lib/uncrustify/Uncrustify.cmake index 6cbd896..fedd417 100644 --- a/cmake/myx/lib/uncrustify/Uncrustify.cmake +++ b/cmake/myx/lib/uncrustify/Uncrustify.cmake @@ -47,7 +47,7 @@ function(myx_uncrustify TARGET_NAME) # Динамически сгенерированные файлы исключаются get_target_property(__target_type ${TARGET_NAME} TYPE) - if((${__target_type} STREQUAL "INTERFACE_LIBRARY") AND (${CMAKE_VERSION} VERSION_LESS "3.15.0")) + if((${__target_type} STREQUAL "INTERFACE_LIBRARY") AND (${CMAKE_VERSION} VERSION_LESS "3.17.0")) get_target_property(__s1 ${TARGET_NAME} INTERFACE_SOURCES) if(__s1) list(APPEND __all_sources ${__s1}) @@ -68,7 +68,8 @@ function(myx_uncrustify TARGET_NAME) set(__fixed_config ${PROJECT_BINARY_DIR}/uncrustify-${TARGET_NAME}.cfg) - add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-${TARGET_NAME}.cfg + add_custom_command(OUTPUT ${__fixed_config} + DEPENDS ${ARG_CONFIG} COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc -c ${ARG_CONFIG} -o ${__fixed_config}) list(APPEND __options -c ${__fixed_config}) diff --git a/cmake/myx_setup.cmake b/cmake/myx_setup.cmake index 8645d54..6f254ba 100644 --- a/cmake/myx_setup.cmake +++ b/cmake/myx_setup.cmake @@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR}) set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR}) endif() if(MYX_CMAKE_DIR) - find_package(MyxCMake 2.0.32 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.0.33 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() if(MYX_CMAKE_USE_SYSTEM) - find_package(MyxCMake 2.0.32 REQUIRED) + find_package(MyxCMake 2.0.33 REQUIRED) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake) diff --git a/src/myx-example-qt5-console/main.cpp b/src/myx-example-qt5-console/main.cpp deleted file mode 100644 index 69d5798..0000000 --- a/src/myx-example-qt5-console/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "config_p.hpp" -#include "git_info_p.hpp" - -#include -#include -#include - -int main( int argc, char** argv ) -{ - QCoreApplication app( argc, argv ); - - qDebug() << "Qt5"; - qDebug() << "Min Linux: " << MINLINUX_MAJOR << "." << MINLINUX_MINOR << "." << MINLINUX_PATCH; - - return( 0 ); -}