From 94b2c1de8354d3377f329c02107f6a7bc218499c Mon Sep 17 00:00:00 2001 From: Dimitrij Mijoski Date: Thu, 11 May 2023 23:45:20 +0200 Subject: [PATCH] Modernize usage of Vcpkg in CI Use Vcpkg's manifest mode. --- .github/workflows/cmake.yml | 6 +----- README.md | 6 +++--- vcpkg.json | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 vcpkg.json diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a9bb8d80..8d577900 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -51,18 +51,14 @@ jobs: run: | echo "local_app_data=$LOCALAPPDATA" >> $GITHUB_ENV echo "vcpkg_root=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - vcpkg search icu | awk '$1=="icu"{ print "icu_ver="$2 }' >> $GITHUB_ENV - uses: actions/cache@v3 with: # use backslashes in path here for Windows. path: ${{ env.local_app_data }}\vcpkg\archives - key: windows-vcpkg-cache-${{ env.icu_ver }} + key: windows-vcpkg-cache-${{ hashFiles('vcpkg.json') }} restore-keys: windows-vcpkg-cache- - - name: Pull Vcpkg dependencies - run: vcpkg install icu getopt --triplet=x64-windows - - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} env: diff --git a/README.md b/README.md index 29d4d3e1..e6b8c904 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ manuals. 1. Install Visual Studio 2017 or newer. Alternatively, you can use Visual Studio Build Tools. 2. Install Git for Windows and Cmake. -3. Install vcpkg in some folder, e.g. in `c:\vcpkg`. -4. Run `vcpkg install icu getopt --triplet=x64-windows`. -5. Run the commands bellow. +3. Install Vcpkg in some folder, e.g. in `c:\vcpkg`. +4. Run the commands bellow. Vcpkg will work in manifest mode and it will + automatically install the dependencies. diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..829209a3 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,17 @@ +{ + "builtin-baseline": "2f9972005f61f02fa3cda7fc062d1b834b534b8d", + "dependencies": [ + { + "name": "catch2", + "version>=": "2.13.9" + }, + { + "name": "getopt", + "version>=": "0#2" + }, + { + "name": "icu", + "version>=": "69.1#18" + } + ] +}