I am trying to use vcpkg for a protobuf c++ library. That seems okay so far.
But I also use protoc in my build process, that is the protobuf compiler.
I had a custom FindProtobuf that had some functions that did the compilation with protoc. It declared a function called protobuf_generate_cpp. This is missing when I use:
set(CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake)
I have this in my CMakeLists.txt:
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/scripts/cmake" ${CMAKE_MODULE_PATH})
which defines the function but it doesn't take effect when I use
CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
It used to take effect but it doesn't now that I'm using vcpkg.
I see that there is a file in the vcpkg installed directory
vcpkg/installed/x64-windows/share/protobuf/protobuf-module.cmake
with the comment:
This file contains backwards compatibility patches for various legacy functions and variables
It seems to support the functionality I want.
How do I get my cmake scripts to see it and use it?
thanks.
I am trying to use vcpkg for a protobuf c++ library. That seems okay so far.
But I also use protoc in my build process, that is the protobuf compiler.
I had a custom FindProtobuf that had some functions that did the compilation with protoc. It declared a function called protobuf_generate_cpp. This is missing when I use: set(CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake) I have this in my CMakeLists.txt: set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/scripts/cmake" ${CMAKE_MODULE_PATH}) which defines the function but it doesn't take effect when I use CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake It used to take effect but it doesn't now that I'm using vcpkg.
I see that there is a file in the vcpkg installed directory vcpkg/installed/x64-windows/share/protobuf/protobuf-module.cmake with the comment:
This file contains backwards compatibility patches for various legacy functions and variables
It seems to support the functionality I want. How do I get my cmake scripts to see it and use it? thanks.