refactor: Add vcpkg installation step to build-project.yaml

- Add a new step to install vcpkg by cloning the repository and running the bootstrap script
- Set the VCPKG_ROOT environment variable to the vcpkg directory in the workspace
- Add the vcpkg executable to the PATH
This commit is contained in:
Roy Shilkrot
2024-07-11 12:21:43 -04:00
parent d8de0e9b0c
commit c0366e96be
3 changed files with 17 additions and 7 deletions

View File

@@ -271,6 +271,15 @@ jobs:
"pluginName=${ProductName}" >> $env:GITHUB_OUTPUT
"pluginVersion=${ProductVersion}" >> $env:GITHUB_OUTPUT
-name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg && bootstrap-vcpkg.bat
# Configure the VCPKG_ROOT environment variable
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV
# Add the vcpkg executable to the PATH
Add-Content $env:GITHUB_PATH "${{ github.workspace }}/vcpkg"
- name: Build Plugin 🧱
uses: ./.github/actions/build-plugin
with:

View File

@@ -60,8 +60,7 @@
"warnings": { "dev": true, "deprecated": true },
"cacheVariables": {
"QT_VERSION": "6",
"CMAKE_SYSTEM_VERSION": "10.0.18363.657",
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
"CMAKE_SYSTEM_VERSION": "10.0.18363.657"
}
},
{
@@ -70,8 +69,7 @@
"displayName": "Windows x64 CI build",
"description": "Build for Windows x64 on CI",
"cacheVariables": {
"CMAKE_COMPILE_WARNING_AS_ERROR": true,
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
"CMAKE_COMPILE_WARNING_AS_ERROR": true
}
},
{

View File

@@ -1,6 +1,9 @@
set(OPENSSL_ROOT_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_installed/x64-windows"
CACHE STRING "Path to OpenSSL")
if(WIN32)
set(OPENSSL_ROOT_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_installed/x64-windows"
CACHE STRING "Path to OpenSSL")
endif()
find_package(OpenSSL REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenSSL::SSL)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenSSL::Crypto)