Skip to content

Commit

Permalink
Merge pull request #98 from AGH-Code-Industry/twarug/readme_update
Browse files Browse the repository at this point in the history
Readme Update & Cmake
  • Loading branch information
Chris-plusplus authored Apr 19, 2024
2 parents 11e85f6 + f3b5374 commit c32989c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
with:
version: 13
platform: x64



- name: Conan version
run: echo "${{ steps.conan.outputs.version }}"

- name: GitHub Cache Action for conan
- name: GitHub Cache Action for Conan
id: cache-conan
uses: actions/cache@v3
env:
Expand All @@ -45,26 +44,14 @@ jobs:
key: ${{ runner.os }}-builder-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }}
restore-keys: ${{ runner.os }}-builder-${{ env.cache-name }}-

#- name: Detect Conan Profile
# run: |
# conan profile detect --force

#- name: Conan Profile Change Compiler Standard
# run: |
# sed -i 's/compiler.cppstd=gnu17/compiler.cppstd=gnu20/g' ~/.conan2/profiles/default
# conan profile show

#- name: Install Conan Pkg's
# run: conan install ${{github.workspace}} --output-folder=${{github.workspace}}/build --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True

- name: Configure CMake
run: |
cmake ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
- name: Run Tests
working-directory: ${{github.workspace}}/build
run: ./archimedes_tests

Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,28 @@ to bump archimedes version using
git submodule update --remote
```


# Compiling

Prerequred:
- Conan 2.x
- git
- CMake >= 3.19

```sh
pip install conan
conan profile detect --force
mkdir build
conan install . --output-folder=build --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build .
git clone https://github.com/AGH-Code-Industry/archimedes
```
```sh
cd archimedes
```

```sh
cmake . -B build -DCMAKE_BUILD_TYPE=<Release/Debug> -DARCHIMEDES_FORCE_CONAN_INSTALL=TRUE
```
```sh
cmake --build ./build
```

# Running Tests
If you have followed [Compiling](#Compiling) section, you should be able run tests
```sh
Expand All @@ -49,15 +61,18 @@ cd build
# Project structure
```
- archimedes
- conanfile.py
- CMakeLists.txt
- README.md
- LICENSE.md
- extern
- ... <zależności, które postanowimy trzymać razem z projektem np. glad>
- cmake
- ... <pliki cmake>
- include
- ... <headery .h projektu>
- ... <pliki nagłówkowe .h i implementacje szablonów .hpp>
- src
- ... <pliki źródłowe .cpp projektu>
- ... <pliki źródłowe .cpp>
- archimedes_bin
- ... <przykładowy projekt testowy>
- tests
- ... <pliki źródłowe testów jednostkowych>
- ... <pliki źródłowe .cpp testów jednostkowych>
```
5 changes: 3 additions & 2 deletions cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ if(ARCHIMEDES_FORCE_CONAN_INSTALL OR NOT EXISTS "${PROJECT_SOURCE_DIR}/cmake/con
endif()

execute_process(
COMMAND "conan profile detect --force"
)
COMMAND "conan" "profile" "detect" "--force"
COMMAND_ERROR_IS_FATAL ANY
)

file(MAKE_DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/conan_files/${ARCHIMEDES_BUILD_TYPE}/")

Expand Down

0 comments on commit c32989c

Please sign in to comment.