diff --git a/.cmake-format b/.cmake-format index a52c7d6..8c355cf 100644 --- a/.cmake-format +++ b/.cmake-format @@ -48,6 +48,7 @@ parse: kwargs: NAME: 1 VERSION: 1 + NAMESPACE: 1 INCLUDE_DIR: 1 INCLUDE_DESTINATION: 1 BINARY_DIR: 1 diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 3ee6d30..8b12266 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -3,14 +3,22 @@ name: Documentation on: push: tags: - - '*' + - "*" + +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: name: Build and publish documentation runs-on: macos-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: Install dependencies run: | @@ -19,7 +27,7 @@ jobs: - name: Build run: | - cmake -Hdocumentation -Bbuild + cmake -Sdocumentation -Bbuild cmake --build build --target GenerateDocs - name: Publish diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 997da70..606dddd 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -10,28 +10,33 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: build and install library - run: | - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release - sudo cmake --build build --target install - rm -rf build + - uses: actions/checkout@v2 - - name: configure - run: cmake -Htest -Bbuild -DTEST_INSTALLED_VERSION=1 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: build - run: cmake --build build --config Debug -j4 + - name: build and install library + run: | + cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release + sudo cmake --build build --target install + rm -rf build - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + run: cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1 + + - name: build + run: cmake --build build --config Debug -j4 + + - name: test + run: | + cd build + ctest --build-config Debug diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cc82132..a2a098f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,22 +10,27 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: - runs-on: macos-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild + - uses: actions/checkout@v2 - - name: build - run: cmake --build build --config Debug -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + run: cmake -Stest -Bbuild -DCMAKE_BUILD_TYPE=Debug + + - name: build + run: cmake --build build -j4 + + - name: test + run: | + cd build + ctest --build-config Debug diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 85afe23..5c3853e 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -8,19 +8,26 @@ on: branches: - master +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Hstandalone -Bbuild + - uses: actions/checkout@v2 - - name: build - run: cmake --build build -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: run - run: ./build/Greeter + - name: configure + run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_TYPE=Debug + + - name: build + run: cmake --build build -j4 + + - name: run + run: ./build/Greeter diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 48d1fa5..ba20a70 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,21 +8,28 @@ on: branches: - master +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + jobs: build: - runs-on: macos-latest - + steps: - - uses: actions/checkout@v1 - - - name: Install format dependencies - run: | - brew install clang-format - pip3 install cmake_format==0.6.11 pyyaml + - uses: actions/checkout@v2 - - name: configure - run: cmake -Htest -Bbuild + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: check style - run: cmake --build build --target check-format + - name: Install format dependencies + run: | + brew install clang-format + pip3 install cmake_format==0.6.11 pyyaml + + - name: configure + run: cmake -Stest -Bbuild + + - name: check style + run: cmake --build build --target check-format diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index dd62cc8..a36711d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,25 +11,30 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1 + - uses: actions/checkout@v2 - - name: build - run: cmake --build build --config Debug -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug - - name: collect code coverage - run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" + - name: build + run: cmake --build build -j4 + + - name: test + run: | + cd build + ctest --build-config Debug + + - name: collect code coverage + run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8f6d2b2..a52b0ae 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,22 +10,27 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: - runs-on: windows-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild + - uses: actions/checkout@v2 - - name: build - run: cmake --build build --config Debug -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + run: cmake -Stest -Bbuild + + - name: build + run: cmake --build build --config Debug -j4 + + - name: test + run: | + cd build + ctest --build-config Debug diff --git a/.gitignore b/.gitignore index a4cfc5d..d54a4f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /build* /.vscode +/cpm_modules .DS_Store \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 81e35e6..550a081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ string(TOLOWER ${PROJECT_NAME}/version.h VERSION_HEADER_LOCATION) packageProject( NAME ${PROJECT_NAME} VERSION ${PROJECT_VERSION} + NAMESPACE ${PROJECT_NAME} BINARY_DIR ${PROJECT_BINARY_DIR} INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index 8373176..f4fd8a1 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -11,9 +11,8 @@ CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) CPMAddPackage( NAME MCSS DOWNLOAD_ONLY YES - # TODO: patched version until https://github.com/mosra/m.css/pull/171 is resolved - GITHUB_REPOSITORY TheLartians/m.css - GIT_TAG 1bf162b96d5bfefc9967a80cef138f1270ffa415 + GITHUB_REPOSITORY mosra/m.css + GIT_TAG 42d4a9a48f31f5df6e246c948403b54b50574a2a ) # ---- Doxygen variables ---- diff --git a/standalone/CMakeLists.txt b/standalone/CMakeLists.txt index 23ff942..4bb837d 100644 --- a/standalone/CMakeLists.txt +++ b/standalone/CMakeLists.txt @@ -27,4 +27,4 @@ add_executable(GreeterStandalone ${sources}) set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter") -target_link_libraries(GreeterStandalone Greeter cxxopts) +target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts)