Skip to content

Commit

Permalink
Build system tweaks (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitlith authored Jul 14, 2022
1 parent b4d9afa commit 717386b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ jobs:
name: Set up vcpkg for Unix
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh

- name: Install dependencies
run: ${{ env.VCPKG_ROOT }}/vcpkg install protobuf protobuf:${{ matrix.triplet }}

- name: Configure CMake
run: cmake -S "${{github.workspace}}" -B "${{env.CMAKE_BUILD_DIR}}"

Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ find_library(OPENVR_LIB openvr_api HINTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/
# Installation:
# Please refer to this readme to install protobuf in your system: https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
# WARNING: CLang has an arror building protobuf messages, use MSVC 2019
INCLUDE(FindProtobuf)
find_package(protobuf CONFIG REQUIRED)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "")
find_package(Protobuf CONFIG REQUIRED)
protobuf_generate_cpp(PROTO_SRC PROTO_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/bridge/ProtobufMessages.proto")
SET_SOURCE_FILES_PROPERTIES(${PROTO_SRC} ${PROTO_INCL} PROPERTIES GENERATED TRUE)

Expand Down Expand Up @@ -99,6 +99,7 @@ add_custom_command(
)

# Copy libprotobuf dll to output folder
# NOTE: This only works with Release/RelWithDebInfo, because Debug uses libprotobufd.dll
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
Expand Down
7 changes: 7 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "slimevr-openvr-driver",
"version": "0.2.0",
"dependencies": [
"protobuf"
]
}

0 comments on commit 717386b

Please sign in to comment.