Skip to content

Commit

Permalink
use vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
youyuanwu committed Nov 8, 2023
1 parent f58d872 commit ebbff53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 66 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@ jobs:
- name: Get specific version CMake, v3.21.2
uses: lukka/[email protected]

- name: Get Boost
uses: MarkusJx/[email protected]
id: install-boost
- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: ${{ matrix.BOOST_VERSION }}
toolset: msvc
platform_version: 2022
link: static
vcpkgGitCommitId: 486a4640db740f5994e492eb60748111dfc48de7

- name: Get OpenCppCoverage
if: ${{ matrix.BUILD_TYPE == 'Debug' }}
Expand Down
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
cmake_minimum_required(VERSION 3.14)
# configure vcpkg
# we use CmakePresets.json to point to vcpkg
if ("$ENV{VCPKG_ROOT}" STREQUAL "")
message(FATAL_ERROR "VCPKG_ROOT not found")
endif()

#project(winasio VERSION 0.0.1 LANGUAGES CXX)
project(winasio)

message(STATUS "vcpkg installed dir: ${VCPKG_INSTALLED_DIR}")

set(winasio_MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(winasio_MAIN_PROJECT ON)
endif()

if(winasio_MAIN_PROJECT)
# configure vcpkg
# we use CmakePresets.json to point to vcpkg
if ("$ENV{VCPKG_ROOT}" STREQUAL "")
message(FATAL_ERROR "VCPKG_ROOT not found")
endif()
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif(winasio_MAIN_PROJECT)

project(winasio VERSION 0.0.1 LANGUAGES CXX)

message(STATUS "vcpkg installed dir: ${VCPKG_INSTALLED_DIR}")

option(winasio_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ${winasio_MAIN_PROJECT})
option(winasio_BuildExamples "Build examples" ${winasio_MAIN_PROJECT})

Expand Down
46 changes: 0 additions & 46 deletions CMakePresets.json

This file was deleted.

0 comments on commit ebbff53

Please sign in to comment.