diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fb783c7..d5eb1b0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,16 +1,16 @@ -FROM ubuntu:24.04 +FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu24.04 LABEL maintainer="Michel Estermann " ARG CLANG_VERSION=18 ARG GCC_VERSION=14 -ARG UBUNTU_BASE=noble RUN apt-get update \ && apt-get -qq install -y --no-install-recommends \ make \ build-essential \ ninja-build \ + cmake \ ccache \ clang-18 \ clang-tidy-18 \ @@ -23,6 +23,8 @@ RUN apt-get update \ git \ python3-full \ gcc-14 \ + file \ + ssh-client \ && rm -rf /var/lib/apt/lists/* # Install locales package and generate en_US.UTF-8 locale @@ -32,42 +34,22 @@ RUN apt-get update \ && update-locale LANG=en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -# Set environment variables +# Install locales and set to english ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8 - -# Install locales and set to english -ENV LANG en_US.UTF-8 RUN echo $LANG UTF-8 > /etc/locale.gen + ENV VIRTUAL_ENV=/opt/venv RUN python3 -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" -#install cmake -RUN pip3 install cmake==3.31.4 -#install conan -RUN pip3 install conan==2.11 -RUN pip3 install python-dateutil==2.9.0 - -# pre-commit -RUN pip3 install pre-commit==4.0.1 -RUN pip3 install yamlfmt==1.1.1 - -# cmake-format -RUN pip3 install cmake-format==0.6.13 - -# gcovr -RUN pip3 install gcovr==8.2 - -# docu stuff -RUN pip3 install Sphinx==8.1.3 -RUN pip3 install sphinx_rtd_theme==3.0.2 -RUN pip3 install breathe==4.35.0 -RUN pip3 install sphinx_mdinclude==0.6.2 +COPY py-requirements.txt requirements.txt +RUN pip3 install --requirement requirements.txt +RUN pip3 install aqtinstall==3.2.1 #install qt RUN apt-get update \ @@ -95,6 +77,9 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +RUN aqt install-tool linux desktop tools_ifw qt.tools.ifw.47 +ENV PATH="/Tools/QtInstallerFramework/4.7/bin:$PATH" + # lcov and doxygen RUN apt-get update \ && apt-get -qq install -y --no-install-recommends \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 48d7d08..88c4459 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "name": "C++", "build": { + "context": "..", "dockerfile": "Dockerfile", "args": { "CLANG_VERSION": "18", @@ -8,12 +9,14 @@ } }, "mounts": [ - "source=${localEnv:HOME}/.conan2,target=/home/user/.conan2,type=bind", + "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind", + "source=${localEnv:HOME}/.conan2,target=/home/vscode/.conan2,type=bind", "source=native-ccache,target=/opt/.native-ccache,type=volume" ], + "updateRemoteUserUID": true, "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", - "postAttachCommand": "pre-commit install -f --hook-type pre-commit && conan profile detect --force", + "postAttachCommand": "pre-commit install -f --hook-type pre-commit && conan profile detect --force && conan install . --build=missing --settings=build_type=Debug && conan install . --build=missing --settings=build_type=Release", "customizations": { "vscode": { "extensions": [ @@ -29,7 +32,8 @@ "jnoortheen.nix-ide", "ms-python.python", "hbenl.vscode-test-explorer", - "ms-azuretools.vscode-docker" + "ms-azuretools.vscode-docker", + "codacy-app.codacy" ] } } diff --git a/.github/workflows/ci-linux-sanatizer.yml b/.github/workflows/ci-linux-sanatizer.yml index 2a54230..a3d0365 100644 --- a/.github/workflows/ci-linux-sanatizer.yml +++ b/.github/workflows/ci-linux-sanatizer.yml @@ -18,105 +18,105 @@ jobs: include: - name: ubuntu-22.04-clang-13-address os: ubuntu-22.04 - compiler: clang++-13 + cppcompiler: clang++-13 ccompiler: clang-13 clang-tidy: clang-tidy-13 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-22.04-clang-14-address os: ubuntu-22.04 - compiler: clang++-14 + cppcompiler: clang++-14 ccompiler: clang-14 clang-tidy: clang-tidy-14 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-22.04-clang-15-address os: ubuntu-22.04 - compiler: clang++-15 + cppcompiler: clang++-15 ccompiler: clang-15 clang-tidy: clang-tidy-15 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-24.04-clang-16-address os: ubuntu-24.04 - compiler: clang++-16 + cppcompiler: clang++-16 ccompiler: clang-16 clang-tidy: clang-tidy-16 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-24.04-clang-17-address os: ubuntu-24.04 - compiler: clang++-17 + cppcompiler: clang++-17 ccompiler: clang-17 clang-tidy: clang-tidy-17 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-24.04-clang-18-address os: ubuntu-24.04 - compiler: clang++-18 + cppcompiler: clang++-18 ccompiler: clang-18 clang-tidy: clang-tidy-18 generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-latest-address os: ubuntu-latest - compiler: g++ + cppcompiler: g++ ccompiler: gcc clang-tidy: clang-tidy generator: Ninja profile: linux-clang-address-sanitizers - name: ubuntu-22.04-clang-13-memory os: ubuntu-22.04 - compiler: clang++-13 + cppcompiler: clang++-13 ccompiler: clang-13 clang-tidy: clang-tidy-13 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-22.04-clang-14-memory os: ubuntu-22.04 - compiler: clang++-14 + cppcompiler: clang++-14 ccompiler: clang-14 clang-tidy: clang-tidy-14 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-22.04-clang-15-memory os: ubuntu-22.04 - compiler: clang++-15 + cppcompiler: clang++-15 ccompiler: clang-15 clang-tidy: clang-tidy-15 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-24.04-clang-16-memory os: ubuntu-24.04 - compiler: clang++-16 + cppcompiler: clang++-16 ccompiler: clang-16 clang-tidy: clang-tidy-16 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-24.04-clang-17-memory os: ubuntu-24.04 - compiler: clang++-17 + cppcompiler: clang++-17 ccompiler: clang-17 clang-tidy: clang-tidy-17 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-24.04-clang-18-memory os: ubuntu-24.04 - compiler: clang++-18 + cppcompiler: clang++-18 ccompiler: clang-18 clang-tidy: clang-tidy-18 generator: Ninja profile: linux-clang-memory-sanitizers - name: ubuntu-latest-memory os: ubuntu-latest - compiler: g++ + cppcompiler: g++ ccompiler: gcc clang-tidy: clang-tidy generator: Ninja profile: linux-clang-memory-sanitizers env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} steps: @@ -125,17 +125,17 @@ jobs: uses: actions/cache@v4 with: path: ~/.conan2/p - key: cache-${{ matrix.os }}-${{ matrix.compiler }}-conan-${{ hashFiles('conanfile.txt') }} + key: cache-${{ matrix.os }}-${{ matrix.cppcompiler }}-conan-${{ hashFiles('conanfile.txt') }} restore-keys: | - cache-${{ matrix.os }}-${{ matrix.compiler }}-conan + cache-${{ matrix.os }}-${{ matrix.cppcompiler }}-conan - name: Cache (ccache) uses: actions/cache@v4 with: path: | ~/.cache/ccache - key: ccache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.generator }}-${{ hashFiles('**/CMakeLists.txt') }} + key: ccache-${{ matrix.os }}-${{ matrix.cppcompiler }}-${{ matrix.generator }}-${{ hashFiles('**/CMakeLists.txt') }} restore-keys: | - ccache-${{ matrix.os }}-${{ matrix.compiler }} + ccache-${{ matrix.os }}-${{ matrix.cppcompiler }} - name: Install dependencies run: | sudo apt-get update diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index ede41a0..2cb2e96 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -19,7 +19,7 @@ jobs: - name: ubuntu-22.04-clang-13 os: ubuntu-22.04 build_type: Release - compiler: clang++-13 + cppcompiler: clang++-13 ccompiler: clang-13 clang-tidy: clang-tidy-13 generator: Ninja @@ -28,7 +28,7 @@ jobs: - name: ubuntu-22.04-clang-14 os: ubuntu-22.04 build_type: Release - compiler: clang++-14 + cppcompiler: clang++-14 ccompiler: clang-14 clang-tidy: clang-tidy-14 generator: Ninja @@ -37,7 +37,7 @@ jobs: - name: ubuntu-22.04-clang-15 os: ubuntu-22.04 build_type: Release - compiler: clang++-15 + cppcompiler: clang++-15 ccompiler: clang-15 clang-tidy: clang-tidy-15 generator: Ninja @@ -46,7 +46,7 @@ jobs: - name: ubuntu-22.04-gcc-12 os: ubuntu-22.04 build_type: Debug - compiler: g++-12 + cppcompiler: g++-12 ccompiler: gcc-12 clang-tidy: clang-tidy generator: Ninja @@ -55,7 +55,7 @@ jobs: - name: ubuntu-24.04-clang-16 os: ubuntu-24.04 build_type: Release - compiler: clang++-16 + cppcompiler: clang++-16 ccompiler: clang-16 clang-tidy: clang-tidy-16 generator: Ninja @@ -64,7 +64,7 @@ jobs: - name: ubuntu-24.04-clang-17 os: ubuntu-24.04 build_type: Release - compiler: clang++-17 + cppcompiler: clang++-17 ccompiler: clang-17 clang-tidy: clang-tidy-17 generator: Ninja @@ -73,7 +73,7 @@ jobs: - name: ubuntu-24.04-clang-18 os: ubuntu-24.04 build_type: Release - compiler: clang++-18 + cppcompiler: clang++-18 ccompiler: clang-18 clang-tidy: clang-tidy-18 generator: Ninja @@ -82,7 +82,7 @@ jobs: - name: ubuntu-24.04-clang-18-download-qt os: ubuntu-24.04 build_type: Release - compiler: clang++-18 + cppcompiler: clang++-18 ccompiler: clang-18 clang-tidy: clang-tidy-18 generator: Ninja @@ -91,7 +91,7 @@ jobs: - name: ubuntu-24.04-gcc-13 os: ubuntu-24.04 build_type: Debug - compiler: g++-13 + cppcompiler: g++-13 ccompiler: gcc-13 clang-tidy: clang-tidy generator: Ninja @@ -100,7 +100,7 @@ jobs: - name: ubuntu-24.04-gcc-14 os: ubuntu-24.04 build_type: Debug - compiler: g++-14 + cppcompiler: g++-14 ccompiler: gcc-14 clang-tidy: clang-tidy generator: Ninja @@ -109,7 +109,7 @@ jobs: - name: ubuntu-24.04-gcc-14-download-qt os: ubuntu-24.04 build_type: Debug - compiler: g++-14 + cppcompiler: g++-14 ccompiler: gcc-14 clang-tidy: clang-tidy generator: Ninja @@ -118,7 +118,7 @@ jobs: - name: ubuntu-latest os: ubuntu-latest build_type: Debug - compiler: g++ + cppcompiler: g++ ccompiler: gcc clang-tidy: clang-tidy generator: Ninja @@ -126,7 +126,7 @@ jobs: download_qt: OFF env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} steps: @@ -135,18 +135,18 @@ jobs: uses: actions/cache@v4 with: path: ~/.conan2/p - key: cache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-conan-${{ hashFiles('conanfile.txt') }} + key: cache-${{ matrix.os }}-${{ matrix.cppcompiler }}-${{ matrix.build_type }}-conan-${{ hashFiles('conanfile.txt') }} restore-keys: | - cache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-conan + cache-${{ matrix.os }}-${{ matrix.cppcompiler }}-${{ matrix.build_type }}-conan - name: Cache (ccache) uses: actions/cache@v4 with: path: | ~/.cache/ccache - key: ccache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.generator }}-${{ hashFiles('**/CMakeLists.txt') + key: ccache-${{ matrix.os }}-${{ matrix.cppcompiler }}-${{ matrix.build_type }}-${{ matrix.generator }}-${{ hashFiles('**/CMakeLists.txt') }} restore-keys: | - ccache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }} + ccache-${{ matrix.os }}-${{ matrix.cppcompiler }}-${{ matrix.build_type }} - name: Install dependencies run: | sudo apt-get update @@ -182,8 +182,12 @@ jobs: working-directory: ./build - name: CMake build docs run: cmake --build ./build --target doxygen-docs --config ${{ matrix.build_type }} - - name: CMake build package - run: cmake --build ./build --target package --config ${{ matrix.build_type }} + - name: CMake build packages + run: cpack + working-directory: ./build + - name: CMake build source package + run: cpack --config CPackSourceConfig.cmake + working-directory: ./build - name: Coverage if: matrix.coverage == 'ON' run: | @@ -198,3 +202,4 @@ jobs: path: | ./build/Coronan-*.deb ./build/Coronan-*.tar.gz + ./build/Coronan-*.run diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index ff3afc3..53c6ee2 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -19,24 +19,24 @@ jobs: - name: macOS-13-clang os: macOS-13 build_type: Release - compiler: clang++ + cppcompiler: clang++ ccompiler: clang generators: Ninja - name: macOS-14-clang os: macOS-14 build_type: Release - compiler: clang++ + cppcompiler: clang++ ccompiler: clang generators: Ninja - name: macOS-15-clang os: macOS-15 build_type: Release - compiler: clang++ + cppcompiler: clang++ ccompiler: clang generators: Ninja env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} steps: @@ -54,7 +54,7 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@v4 with: - version: 6.8.2 + version: 6.8.3 host: mac target: desktop arch: clang_64 @@ -74,13 +74,15 @@ jobs: - name: CTest run: ctest -C Debug working-directory: ./build - - name: CMake build docs and package + - name: CMake build packages run: | - cmake --build ./build --target doxygen-docs --config ${{ matrix.build_type }} - cmake --build ./build --target package --config ${{ matrix.build_type }} + cpack + cpack --config CPackSourceConfig.cmake + working-directory: ./build - uses: actions/upload-artifact@v4 with: name: ${{ matrix.name }}-artifacts path: | ./build/Coronan-*.tar.gz ./build/Coronan-*.pkg + ./build/Coronan-*.dmg diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml new file mode 100644 index 0000000..d5b67d3 --- /dev/null +++ b/.github/workflows/ci-release.yml @@ -0,0 +1,166 @@ +--- +name: Release + +on: + push: + tags: + - v* + branches: + - main # nur, wenn Tag auf main ist + +jobs: + build-linux: + runs-on: ubuntu-24.04 + env: + CXX: g++ + CC: gcc + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ccache ninja-build dpkg pkg-config doxygen lcov + sudo apt-get install -y --no-install-recommends libgl1-mesa-dev freeglut3-dev + - name: Install Qt + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends qt6-base-dev qt6-tools-dev qt6-tools-dev-tools libqt6charts6 libqt6charts6-dev libqt6opengl6 libqt6opengl6-dev '^libxcb.*-dev' libgles2-mesa-dev libx11-xcb-dev libgl1-mesa-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r py-requirements.txt + - name: Set conan compiler env + run: conan profile detect + - name: conan install + run: conan install . --build=missing --settings=build_type=Release --settings=compiler.cppstd=17 + - name: CMake configure + run: | + cmake -S . --preset=linux-gcc-release + - name: CMake build + run: cmake --build ./build --config Release + - name: CMake build packages + run: | + cpack --config ${{ matrix.build_type }} + cpack --config CPackSourceConfig.cmake + working-directory: ./build + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }}-artifacts + path: | + ./build/Coronan-*.deb + ./build/Coronan-*.tar.gz + ./build/Coronan-*.run + + build-windows: + runs-on: windows-2025 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + choco install doxygen.install + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r py-requirements.txt + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: 6.8.3 + host: windows + target: desktop + arch: win64_msvc2022_64 + modules: qtcharts + tools: tools_ifw + - name: setup-msvc-dev + uses: TheMrMilchmann/setup-msvc-dev@v3 + with: + arch: x64 + - name: Set conan compiler env + run: conan profile detect + - name: conan install + run: conan install . --build=missing --settings=build_type=Release --settings=compiler.cppstd=17 + - name: CMake configure + run: | + cmake -S . --preset=visual-studio-2022-release + - name: CMake build + run: cmake --build ./build --config Release + - name: CMake build packages + run: | + cpack --config ${{ matrix.build_type }} + cpack --config CPackSourceConfig.cmake + working-directory: ./build + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }}-artifacts + path: | + ./build/Coronan-*.zip + ./build/Coronan-*.msi + ./build/Coronan-*.exe + + build-macos: + runs-on: macOS-15 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: brew install ninja doxygen sphinx-doc + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r py-requirements.txt + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: 6.8.3 + host: mac + target: desktop + arch: clang_64 + modules: qtcharts + tools: tools_ifw + - name: Set conan compiler env + run: conan profile detect + - name: conan install + run: conan install . --build=missing --settings=build_type=Release + - name: CMake configure + run: | + cmake -S . -B ./build -G "Ninja" -DCMAKE_BUILD_TYPE=Release + - name: CMake build + run: cmake --build ./build --config Release + - name: CMake build packages + run: cpack --config ${{ matrix.build_type }} + working-directory: ./build + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }}-artifacts + path: | + ./build/Coronan-*.tar.gz + ./build/Coronan-*.pkg + ./build/Coronan-*.dmg + + release: + needs: [build-linux, build-windows, build-macos] + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: ./downloads + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} # z. B. v1.2.3 + name: Release ${{ github.ref_name }} + files: | + downloads/**/* diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index c3e1339..b382c65 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -16,21 +16,21 @@ jobs: fail-fast: false matrix: include: - - name: windows-VS-2022 + - name: windows-2022-VS-2022 os: windows-2022 build_type: Release - compiler: cl + cppcompiler: cl ccompiler: cl generators: Visual Studio 17 2022 - - name: windows-VS-2025 + - name: windows-2025-VS-2022 os: windows-2025 build_type: Release - compiler: cl + cppcompiler: cl ccompiler: cl generators: Visual Studio 17 2022 env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} steps: @@ -49,7 +49,7 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@v4 with: - version: 6.8.2 + version: 6.8.3 host: windows target: desktop arch: win64_msvc2022_64 @@ -73,11 +73,15 @@ jobs: working-directory: ./build - name: CMake build docs run: cmake --build ./build --target doxygen-docs --config ${{ matrix.build_type }} - - name: CMake build package - run: cmake --build ./build --target package --config ${{ matrix.build_type }} + - name: CMake build packages + run: | + cpack --config ${{ matrix.build_type }} + cpack --config CPackSourceConfig.cmake + working-directory: ./build - uses: actions/upload-artifact@v4 with: name: ${{ matrix.name }}-artifacts path: | ./build/Coronan-*.zip ./build/Coronan-*.msi + ./build/Coronan-*.exe diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile deleted file mode 100644 index 581f68e..0000000 --- a/.gitpod.Dockerfile +++ /dev/null @@ -1,58 +0,0 @@ -FROM gitpod/workspace-full-vnc:2025-01-15-08-55-28 - -# More information: https://www.gitpod.io/docs/config-docker/ - -LABEL maintainer="Michel Estermann " - -USER root - -#install qt -RUN apt-get update \ - && apt-get -qq install -y --no-install-recommends software-properties-common \ - && apt-get -qq install -y --no-install-recommends qt6-base-dev qt6-tools-dev qt6-tools-dev-tools libqt6charts6 libqt6charts6-dev libqt6opengl6 libqt6opengl6-dev \ - && apt-get -qq install -y --no-install-recommends libxcb-xinerama0-dev \ - && apt-get -qq install -y --no-install-recommends '^libxcb.*-dev' libgles2-mesa-dev libx11-xcb-dev libgl1-mesa-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev \ - && apt-get -qq install -y --no-install-recommends perl \ - && apt-get clean && rm -rf /var/lib/apt/lists/* - - -# install clang 19 -RUN apt-get update \ - && apt-get -qq install -y --no-install-recommends clang-18 clang-tidy-18 clang-format-18 clangd-18 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# lcov and doxygen -RUN apt-get update \ - && apt-get -qq install -y --no-install-recommends lcov doxygen graphviz \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN apt-get update \ - && apt-get -qq install -y --no-install-recommends ccache ninja-build \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN pyenv install 3.12.7 && pyenv global 3.12.7 - -#install cmake -RUN pip3 install cmake==4.0.0 -#install conan -RUN pip3 install conan==2.11 -RUN pip3 install python-dateutil==2.9.0 - -# pre-commit -RUN pip3 install pre-commit==4.2.0 -RUN pip3 install yamlfmt==1.1.1 - -USER gitpod - - -# cmake-format -RUN pip3 install cmake-format==0.6.13 - -# gcovr -RUN pip3 install gcovr==8.3 - - -RUN echo 'export PIP_USER=false' >> ~/.bashrc diff --git a/.gitpod.yml b/.gitpod.yml index 887fa5d..4fd2783 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,6 @@ --- image: - file: .gitpod.Dockerfile + file: .devcontainer/Dockerfile tasks: - before: | @@ -9,7 +9,7 @@ tasks: export CXX=clang++-18 export CC=clang-18 conan profile detect - init: conan install . -pr:a conan_profiles/clang_debug_linux --build=missing + init: conan install . --build=missing --settings=build_type=Debug command: cmake -S . -B build --preset=linux-clang-debug vscode: diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index a45735b..0000000 --- a/.lgtm.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -# for full syntax documentation see: https://lgtm.com/help/lgtm/lgtm.yml-configuration-file -path_classifiers: - test: - - '*/tests/*.cpp' -extraction: - cpp: - prepare: - packages: - - qt5-default - - libqt5charts5-dev - script: - - mkdir ~/.conan - - cat /usr/local/share/ca-certificates/semmle-cache-ca/semmle-cache-ca.crt >> ~/.conan/cacert.pem - - python3 -m pip install --upgrade pip setuptools - - python3 -m pip install conan - - python3 -m pip install cmake - - source ~/.profile - configure: - command: - - mkdir build - - cmake -DQt5Charts_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5Charts/Qt5ChartsConfig.cmake -DENABLE_COVERAGE:BOOL=TRUE -S . -B build - index: - build_command: cmake --build ./build -- -j2 diff --git a/CMakePresets.json b/CMakePresets.json index 97eeda2..b7385da 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -349,42 +349,6 @@ "targets": [ "doxygen-docs" ] - }, - { - "name": "package-gcc", - "description": "build package (gcc).", - "displayName": "Package (gcc)", - "inherits": "gcc-release", - "configurePreset": "linux-gcc-release", - "configuration": "Release", - "targets": [ - "doxygen-docs", - "package" - ] - }, - { - "name": "package-clang", - "description": "build package (clang).", - "displayName": "Package (clang)", - "inherits": "clang-release", - "configurePreset": "linux-clang-release", - "configuration": "Release", - "targets": [ - "doxygen-docs", - "package" - ] - }, - { - "name": "package-windows", - "description": "build package (Visual Studio 2022).", - "displayName": "Package (win)", - "inherits": "visual-studio-release", - "configurePreset": "visual-studio-2022-release", - "configuration": "Release", - "targets": [ - "doxygen-docs", - "package" - ] } ], "testPresets": [ @@ -418,5 +382,71 @@ "displayName": "Unittest", "configurePreset": "visual-studio-2022-debug" } + ], + "packagePresets": [ + { + "name": "tgz-gcc", + "displayName": "Tar GZip", + "configurePreset": "linux-gcc-release", + "generators": [ + "TGZ" + ] + }, + { + "name": "tgz-clang", + "displayName": "Tar GZip", + "configurePreset": "linux-clang-release", + "generators": [ + "TGZ" + ] + }, + { + "name": "debian-gcc", + "displayName": "Debian package", + "configurePreset": "linux-gcc-release", + "generators": [ + "DEB" + ] + }, + { + "name": "debian-clang", + "displayName": "Debian package", + "configurePreset": "linux-clang-release", + "generators": [ + "DEB" + ] + }, + { + "name": "ifw-gcc", + "displayName": "Qt installer", + "configurePreset": "linux-gcc-release", + "generators": [ + "IFW" + ] + }, + { + "name": "ifw-gclang", + "displayName": "Qt installer", + "configurePreset": "linux-clang-release", + "generators": [ + "IFW" + ] + }, + { + "name": "ifw-visual-studio-2022", + "displayName": "Windows IFW", + "configurePreset": "visual-studio-2022-release", + "generators": [ + "IFW" + ] + }, + { + "name": "wix-visual-studio-2022", + "displayName": "Windows Wix", + "configurePreset": "visual-studio-2022-release", + "generators": [ + "WIX" + ] + } ] } diff --git a/README.md b/README.md index c50cc9e..06095da 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ It reads the latest data of Corona (Covid-19) cases for a country from the [COVI _The COVID-19 Statistics API_ provides statistics via REST API from the [Johns Hopkins CSSE](https://github.com/CSSEGISandData/COVID-19). -![Screenshot of the qt application](docs/images/Screenshot-qt.png) +![Screenshot of the qt application](images/Screenshot-qt.png) ## Table of content @@ -75,25 +75,29 @@ _The COVID-19 Statistics API_ provides statistics via REST API from the [Johns H This projects is a C++ project template. It includes everything a "Modern" C++ project possibly needs: * C++ 20 Standard - * [GCC](https://gcc.gnu.org/) _(>= gcc 12)_ - * [Clang](https://clang.llvm.org/) + * [GCC](https://gcc.gnu.org/) _(>= gcc-12)_ + * [Clang](https://clang.llvm.org/) _(>= clang-13)_ * Visual Studio 2022 * [conan](https://conan.io/) package Manager -* Libraries used: - * [Qt6](https://www.qt.io/) _(minimal version required: 6.4)_ - * [Poco](https://pocoproject.org/) Networking library - * [RapidJSON](https://rapidjson.org/) - * [Lyra](https://github.com/bfgroup/Lyra) command line arguments parser - * [{fmt}](https://github.com/fmtlib/fmt) formatting library _(std::print is C++23 and therefore not used yet)_ - * [date](https://github.com/HowardHinnant/date) date and time library _(std::chrono::year_month_day is not fully supported in older c++20 compilers (gcc 12, 13 and clang 13-16) therefor it is not used yet)_ +* Dependencies: + * to install: + * [Qt6](https://www.qt.io/) _(minimal version required: 6.4)_ + * with conan: + * [Poco](https://pocoproject.org/) Networking library + * [RapidJSON](https://rapidjson.org/) + * [Lyra](https://github.com/bfgroup/Lyra) command line arguments parser + * [{fmt}](https://github.com/fmtlib/fmt) formatting library _(std::print is C++23 and therefore not used yet)_ + * [date](https://github.com/HowardHinnant/date) date and time library _(std::chrono::year_month_day is not fully supported in older c++20 compilers (gcc 12, 13 and clang 13-16) therefor it is not used yet)_ + * [Catch2](https://github.com/catchorg/Catch2) _(for unittests)__ * Unittests with Coverage using [Catch2](https://github.com/catchorg/Catch2) * CMake with [CMakePresets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) _(CMake >= 3.23)_ * CPack packaging: + * tar gzip archive * Debian package * [Qt Installer Framework](https://doc.qt.io/qtinstallerframework/) * [WIX](https://wixtoolset.org/) @@ -106,6 +110,7 @@ This projects is a C++ project template. It includes everything a "Modern" C++ p * [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) * [cppcheck](http://cppcheck.sourceforge.net/) * [include-what-you-use](https://include-what-you-use.org/) + * [link-what-you-use](https://cmake.org/cmake/help/latest/prop_tgt/LINK_WHAT_YOU_USE.html) * Sanitizers support: * [Address Sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) @@ -115,8 +120,8 @@ This projects is a C++ project template. It includes everything a "Modern" C++ p * [Memory Sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) * Documentation Generation using - * [Doxygen](https://www.doxygen.nl/index.html) - * [doxygen-awesome-css](https://github.com/jothepro/doxygen-awesome-css) + * [Doxygen](https://www.doxygen.nl/index.html) using the _"doxygen-awesome-sidebar-only"_ theme by + * [doxygen-awesome-css](https://github.com/jothepro/doxygen-awesome-css) by default * Code formatting: * [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for C++ files @@ -222,20 +227,19 @@ _Note: Delete the build directory before formatting, otherwise all CMake files i ### CMake options -* `DOWNLOAD_QT6`: Download and build Qt6 otherwise use installed. _Default_: `OFF` -* `ENABLE_TESTING`: Build (and run) unittests. _Default_: `ON` +* `DOWNLOAD_QT6`: Download and build Qt6 otherwise use installed. _Default: `OFF`_ +* `ENABLE_TESTING`: Build (and run) unittests. _Default: `ON`_ * `ENABLE_BUILD_WITH_TIME_TRACE`: Enable [Clang Time Trace Feature](https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature). _Default: `OFF`_ * `ENABLE_PCH`: Enable [Precompiled Headers](https://en.wikipedia.org/wiki/Precompiled_header). _Default: `OFF`_ * `ENABLE_CACHE`: Enable caching if available, e.g. [ccache](https://ccache.dev/) or [sccache](https://github.com/mozilla/sccache). _Default: `ON`_ * `ENABLE_COVERAGE`: Enable coverage reporting for gcc/clang. _Default: `OFF`_ -* `ENABLE_DOXYGEN`: Enable doxygen documentation build ([Doxygen](https://www.doxygen.nl/index.html) must be installed). _Default: `ON`_ if Doxygen is installed `OFF` otherwise._ -* `ENABLE_SPHINX`: Enable sphinx documentation build ([Sphinx](https://www.sphinx-doc.org/) with [Breath](https://breathe.readthedocs.io/) and [sphinx-mdinclude](https://github.com/omnilib/sphinx-mdinclude) must be installed). _Default: `ON`_ if Sphinx is installed `OFF` otherwise._ -* `ENABLE_SANITIZERS`: Enable supported sanitizers". _Default: `OFF`_ -* `ENABLE_SANITIZER_ADDRESS`: Enable [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` == `ON` otherwise `OFF`._ -* `ENABLE_SANITIZER_LEAK`: Enable [leak sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html). _Default: `OFF`_ -* `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR`: Enable [undefined behavior sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` == `ON` otherwise `OFF`._ -* `ENABLE_SANITIZER_THREAD`: Enable [thread sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html). _Default: `OFF`_ -* `ENABLE_SANITIZER_MEMORY`: Enable [memory sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html). _Default: `OFF`_ +* `ENABLE_DOXYGEN`: Enable doxygen documentation build ([Doxygen](https://www.doxygen.nl/index.html) must be installed). _Default: `ON` if Doxygen is installed `OFF` otherwise._ +* `ENABLE_SANITIZERS`: Enable supported sanitizers. _Default: `OFF`_ + * `ENABLE_SANITIZER_ADDRESS`: Enable [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ + * `ENABLE_SANITIZER_LEAK`: Enable [leak sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html). _Default: `OFF`_ + * `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR`: Enable [undefined behavior sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ + * `ENABLE_SANITIZER_THREAD`: Enable [thread sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html). _Default: `OFF`_ + * `ENABLE_SANITIZER_MEMORY`: Enable [memory sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html). _Default: `OFF`_ * `ENABLE_IPO`: Enable intermodular optimization, aka [Link Time Optimization (LTO)](https://llvm.org/docs/LinkTimeOptimization.html). _Default: `OFF`_ * `ENABLE_CPPCHECK`: Enable static analysis with [cppcheck](http://cppcheck.sourceforge.net/). _Default: `ON` if cppcheck is installed `OFF` otherwise._ * `ENABLE_CLANG_TIDY`: Enable static analysis with [clang-tidy](https://clang.llvm.org/extra/clang-tidy/). _Default: `ON` if clang-tidy is installed `OFF` otherwise._ diff --git a/apps/cli/src/main.cpp b/apps/cli/src/main.cpp index 39b8d53..c3d92a4 100644 --- a/apps/cli/src/main.cpp +++ b/apps/cli/src/main.cpp @@ -39,11 +39,11 @@ int main(int argc, char* argv[]) arguments_or_exit_code); auto const latest_data = coronan::CoronaAPIClient{}.request_country_data(country, std::nullopt); - const auto region_info = + auto region_info = coronan::RegionInfo{.name = "", .iso_code = country, .latitude = std::nullopt, .longitude = std::nullopt}; if (start_date.has_value() && end_date.has_value()) { - return coronan::CountryData{.info = region_info, + return coronan::CountryData{.info = std::move(region_info), .latest = latest_data.latest, .timeline = coronan::CoronaAPIClient{} .request_country_data(country, start_date.value(), end_date.value()) @@ -51,7 +51,7 @@ int main(int argc, char* argv[]) } else if (start_date.has_value() && not end_date.has_value()) { - return coronan::CountryData{.info = region_info, + return coronan::CountryData{.info = std::move(region_info), .latest = latest_data.latest, .timeline = coronan::CoronaAPIClient{} @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) .timeline}; } return coronan::CountryData{ - .info = region_info, .latest = latest_data.latest, .timeline = {{latest_data.latest}}}; + .info = std::move(region_info), .latest = latest_data.latest, .timeline = {{latest_data.latest}}}; }(); print_data(country_data); diff --git a/apps/qt/country_overview_table_model.cpp b/apps/qt/country_overview_table_model.cpp index 979e1c0..ae9fb11 100644 --- a/apps/qt/country_overview_table_model.cpp +++ b/apps/qt/country_overview_table_model.cpp @@ -45,12 +45,12 @@ void CountryOverviewTablewModel::populate_data(coronan::CountryData const& count for (auto const& pair : overview_table_entries) { auto const label = QString{pair.first}; - auto const value = std::visit( + auto value = std::visit( overloaded{[](std::string const& arg) { return QString{arg.c_str()}; }, [](auto const& arg) { return arg.has_value() ? QString::number(arg.value()) : QString{"--"}; }}, pair.second); - country_overview_data.push_back(qMakePair(label, value)); + country_overview_data.push_back(qMakePair(label, std::move(value))); } endResetModel(); } diff --git a/appveyor.yml b/appveyor.yml index d0de62a..d1d00dc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,9 @@ before_build: cmake -S %APPVEYOR_BUILD_FOLDER% --preset=visual-studio-2022-release build_script: - - cmd: cmake --build --preset=package-windows + - cmd: |- + cmake --build --preset=visual-studio-release + cmake --build build --target package --config Release test_script: - cmd: ctest --preset=unittest-vs-2022 @@ -35,3 +37,6 @@ artifacts: - path: \build\Coronan-*.msi name: Coronan_installer type: File + - path: \build\Coronan-*.exe + name: Coronan_qt_installer + type: File diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake index 9a5f65c..367ecf6 100644 --- a/cmake/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -4,6 +4,20 @@ set(CPACK_PACKAGE_VENDOR "bbv Software Services AG") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Present the current data of Corona (Covid-19) cases for a country.") set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) set(CPACK_VERBATIM_VARIABLES YES) +set(CPACK_ARCHIVE_THREADS 0) +set(CPACK_SOURCE_GENERATOR TGZ) +set(CPACK_SOURCE_IGNORE_FILES + \\.git/ + build/ + \\.devcontainer/ + \\.github/ + \\.venv/ + \\.vscode/ + \\.cache/ + appveyor.yml + \\.gitpod.yml + \\.codecov.yml +) # WIX installer needs a licence file with .txt ending configure_file(${PROJECT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt COPYONLY) @@ -20,6 +34,7 @@ if(WIN32) # replace existing installations that use the same GUID. set(CPACK_WIX_UPGRADE_GUID "e2b63053-6f9d-4bd1-97b6-97ec70b70a7d") set(CPACK_GENERATOR ZIP WIX) + set(CPACK_SOURCE_GENERATOR ZIP) elseif(APPLE) set(CPACK_GENERATOR TGZ productbuild) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -31,7 +46,12 @@ endif() find_program(DPKG_PROGRAM dpkg) if(DPKG_PROGRAM) list(APPEND CPACK_GENERATOR DEB) - set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) + find_program(SHLIBDEPS_PROGRAMM dpkg-shlibdeps) + if(SHLIBDEPS_PROGRAMM) + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) + else() + message(WARNING "dpkg-shlibdeps not found, skipping shlibdeps") + endif() # DEB package config set(CPACK_DEBIAN_PACKAGE_NAME "coronan") @@ -41,14 +61,24 @@ if(DPKG_PROGRAM) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6widgets6 (>=6.2.4),libqt6charts6 (>=6.2.4)") endif(DPKG_PROGRAM) -# IFW (Qt Installer Framework) config -set(CPACK_IFW_VERBOSE ON) -set(CPACK_IFW_PACKAGE_TITLE "Co[ro]nan") +find_program( + BINARYCREATOR_EXECUTABLE + NAMES binarycreator + HINTS ${CPACK_IFW_ROOT}/bin +) +if(BINARYCREATOR_EXECUTABLE) + message(STATUS "Found binarycreator: ${BINARYCREATOR_EXECUTABLE}") + list(APPEND CPACK_GENERATOR IFW) + # IFW (Qt Installer Framework) config + set(CPACK_IFW_VERBOSE ON) + set(CPACK_IFW_PACKAGE_TITLE "Co[ro]nan") + include(CPackIFW) +endif() + include(CPack) -include(CPackIFW) cpack_add_component( - Coronan_Development + Coronan_Development DISABLED DISPLAY_NAME "coronan SDK" DESCRIPTION "Development components" INSTALL_TYPES Full Developer @@ -62,12 +92,19 @@ cpack_add_component( ) cpack_add_component( - Coronan_Runtime_CLI + Coronan_Runtime_CLI DISABLED DISPLAY_NAME "coronan command line interface" DESCRIPTION "Gui executables" INSTALL_TYPES Full Developer Minimal ) +if(BINARYCREATOR_EXECUTABLE) + # Only allow to install qt application + cpack_ifw_configure_component(Coronan_Development VIRTUAL) + cpack_ifw_configure_component(Coronan_Runtime_GUI ESSENTIAL) + cpack_ifw_configure_component(Coronan_Runtime_CLI VIRTUAL) +endif() + cpack_add_install_type(Full) cpack_add_install_type(Minimal) cpack_add_install_type(Developer DISPLAY_NAME "SDK Development") diff --git a/cmake/Doxygen.cmake b/cmake/Doxygen.cmake index 64bc566..aca03d3 100644 --- a/cmake/Doxygen.cmake +++ b/cmake/Doxygen.cmake @@ -4,11 +4,6 @@ if(Doxygen_FOUND) endif() function(enable_doxygen DOXYGEN_THEME) - - if((NOT DOXYGEN_USE_MDFILE_AS_MAINPAGE) AND EXISTS "${PROJECT_SOURCE_DIR}/README.md") - set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${PROJECT_SOURCE_DIR}/README.md") - endif() - set(DOXYGEN_CALLER_GRAPH YES) set(DOXYGEN_CALL_GRAPH YES) set(DOXYGEN_EXTRACT_ALL YES) @@ -16,6 +11,7 @@ function(enable_doxygen DOXYGEN_THEME) set(DOXYGEN_BUILTIN_STL_SUPPORT YES) set(DOXYGEN_DOT_IMAGE_FORMAT svg) set(DOXYGEN_DOT_TRANSPARENT YES) + set(DOXYGEN_EXCLUDE "${CMAKE_BINARY_DIR}") if("${DOXYGEN_THEME}" STREQUAL "") set(DOXYGEN_THEME "awesome-sidebar") diff --git a/conan_profiles/clang_debug_linux b/conan_profiles/clang_debug_linux index ef71857..f2cb0ad 100644 --- a/conan_profiles/clang_debug_linux +++ b/conan_profiles/clang_debug_linux @@ -3,7 +3,7 @@ arch=x86_64 build_type=Debug compiler=clang compiler.cppstd=20 -compiler.libcxx=libc++11 +compiler.libcxx=libstdc++11 compiler.version=18 os=Linux diff --git a/conan_profiles/clang_release_linux b/conan_profiles/clang_release_linux index a6f3d84..6496876 100644 --- a/conan_profiles/clang_release_linux +++ b/conan_profiles/clang_release_linux @@ -3,7 +3,7 @@ arch=x86_64 build_type=Release compiler=clang compiler.cppstd=20 -compiler.libcxx=libc++11 +compiler.libcxx=libstdc++11 compiler.version=18 os=Linux diff --git a/conan_profiles/gnu_debug_linux b/conan_profiles/gnu_debug_linux index 71e4169..4eb7ff1 100644 --- a/conan_profiles/gnu_debug_linux +++ b/conan_profiles/gnu_debug_linux @@ -3,7 +3,7 @@ arch=x86_64 build_type=Debug compiler=gcc compiler.cppstd=gnu20 -compiler.libcxx=libc++11 +compiler.libcxx=libstdc++11 compiler.version=14 os=Linux diff --git a/conan_profiles/gnu_release_linux b/conan_profiles/gnu_release_linux index 40ae065..bf799db 100644 --- a/conan_profiles/gnu_release_linux +++ b/conan_profiles/gnu_release_linux @@ -3,7 +3,7 @@ arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu20 -compiler.libcxx=libc++11 +compiler.libcxx=libstdc++11 compiler.version=14 os=Linux diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 10baa24..3c49c73 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,8 +1,21 @@ include(GNUInstallDirs) include(Doxygen) +if(EXISTS "${PROJECT_SOURCE_DIR}/README.md") + set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${PROJECT_SOURCE_DIR}/README.md") +endif() + +# enable doxygen documentaion with the "awesome-sidebar" theme enable_doxygen("awesome-sidebar") +add_custom_command( + TARGET doxygen-docs + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/images ${CMAKE_CURRENT_BINARY_DIR}/html/images + COMMENT "Copying image files to Doxygen HTML output directory" + VERBATIM +) + install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR} diff --git a/docs/images/Screenshot-qt.png b/images/Screenshot-qt.png similarity index 100% rename from docs/images/Screenshot-qt.png rename to images/Screenshot-qt.png diff --git a/include/coronan/corona-api_client.hpp b/include/coronan/corona-api_client.hpp index 0cdbaaa..fe23d6f 100644 --- a/include/coronan/corona-api_client.hpp +++ b/include/coronan/corona-api_client.hpp @@ -125,7 +125,7 @@ template CountryData CoronaAPIClientType::request_country_data(std::string const& country_code, std::optional const& date) const { - auto const date_query_string = + auto const& date_query_string = date.has_value() ? fmt::format("date={:%Y-%m-%d}&", sys_days(date.value())) : std::string{""}; auto const region_report_url = corona_api_url + std::string{"reports/total?"} + date_query_string + std::string{"iso="} + std::string{country_code}; @@ -151,8 +151,8 @@ CountryData CoronaAPIClientType::request_country_data(std::string co } else { - auto const exception_msg = details::create_exception_msg(region_report_url, http_response); - throw HTTPClientException{exception_msg}; + auto exception_msg = details::create_exception_msg(region_report_url, http_response); + throw HTTPClientException{std::move(exception_msg)}; } } diff --git a/include/coronan/http_client.hpp b/include/coronan/http_client.hpp index 0d24986..10caa7b 100644 --- a/include/coronan/http_client.hpp +++ b/include/coronan/http_client.hpp @@ -90,7 +90,11 @@ HTTPResponse HTTPClientType::get auto const path = std::invoke([&uri]() { auto path_ = uri.getPathAndQuery(); - return path_.empty() ? "/" : std::move(path_); + if (path_.empty()) + { + path_ = "/"; + } + return path_; }); HTTPRequestType request{"GET", path, "HTTP/1.1"}; diff --git a/py-requirements.txt b/py-requirements.txt index 17d9edc..a658d59 100644 --- a/py-requirements.txt +++ b/py-requirements.txt @@ -1,9 +1,10 @@ -cmake>=3.31.4 +cmake>=3.31,<4.0 conan>=2.15 gcovr>=8.2 pre-commit>=4.0.1 cmake-format>=0.6.13 setuptools>=75.0.0 +python-dateutil==2.9.0 requests>=2.32.2 # not directly required, pinned by Snyk to avoid a vulnerability zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability urllib3>=1.26.19 # not directly required, pinned by Snyk to avoid a vulnerability