diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0b1a9e3..dd1816c 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -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}}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 7716374..ac74b84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..1d61dbd --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "slimevr-openvr-driver", + "version": "0.2.0", + "dependencies": [ + "protobuf" + ] +} \ No newline at end of file