Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CMake

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build_Linux:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Configure Solver
run: cmake ${{github.workspace}} -B ${{github.workspace}}/build

- name: Build Solver
run: cmake --build ${{github.workspace}}/build
33 changes: 33 additions & 0 deletions .github/workflows/CI_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CMake

on:
push:
tags:
- v**

jobs:

build_packages_Linux:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Configure Solver
run: cmake ${{github.workspace}} -B ${{github.workspace}}/build -D PRINT_VERSION=${GITHUB_REF_NAME#v}

- name: Build Solver
run: cmake --build ${{github.workspace}}/build

- name: Build package
run: cmake --build ${{github.workspace}}/build --target package

- name: Build source package
run: cmake --build ${{github.workspace}}/build --target package_source

- name: Make a release
uses: ncipollo/release-action@v1.10.0
with:
artifacts: "build/*.deb,build/*.tar.gz,build/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.4)

project(solver)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/formatter_ex_lib formatter_ex_lib_dir)

add_library(solver_lib ${CMAKE_CURRENT_SOURCE_DIR}/solver_lib/solver.cpp)
add_executable(solver ${CMAKE_CURRENT_SOURCE_DIR}/solver_application/equation.cpp)

target_include_directories(formatter_ex_lib PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/formatter_lib
${CMAKE_CURRENT_SOURCE_DIR}/formatter_ex_lib
${CMAKE_CURRENT_SOURCE_DIR}/solver_lib
)

target_link_libraries(solver formatter_ex_lib formatter_lib solver_lib)

# Инструкции для инсталляции
install(TARGETS solver
RUNTIME DESTINATION bin
)

# Дальше "передаём управление" CPack-у
include(CPack.cmake)
32 changes: 32 additions & 0 deletions CPack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Инклюдим необходимые библиотеки
include(InstallRequiredSystemLibraries)

#Задаём кучу переменных
set(CPACK_PACKAGE_CONTACT xeniacuzmina@yandex.ru)
set(CPACK_PACKAGE_VERSION ${PRINT_VERSION})
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/DESCRIPTION)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ app for solving quadratic equations")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)

# Говорим что игнорить
set(CPACK_SOURCE_IGNORE_FILES
"\\\\.cmake;/build/;/.git/;/.github/"
)

# Говорим что и как инсталлить в архивник с сурсами
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}; /")

set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")

set(CPACK_DEBIAN_PACKAGE_NAME "solverapp-dev")
set(CPACK_DEBIAN_FILE_NAME "solver-${PRINT_VERSION}.deb")
set(CPACK_DEBIAN_PACKAGE_VERSION ${PRINT_VERSION})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "yourfavoriteself")
#set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Solves quadratic equations")
set(CPACK_DEBIAN_PACKAGE_RELEASE 1)

set(CPACK_GENERATOR "DEB")

include(CPack)
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Just feed the program three (3) numbers (a, b, c) and it'll solve ax^2 + bx + c = 0
It's almost like magic, really
Loading