Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
fix: avoid warnings with newer CMake versions (#48)
Browse files Browse the repository at this point in the history
I noticed this with CMake 3.17.1, but may have started earlier. Using
`include()` to load a module does not work because the calls to
`find_package_handle_standard_args()` generate a ton of warnings.
Loading the module using `find_package()` works as expected.
  • Loading branch information
coryan authored Apr 23, 2020
1 parent 3649515 commit 7f63ce1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmake/FindgRPC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ find_package(Threads REQUIRED)
# Load the module to find protobuf with proper targets. Do not use
# `find_package()` because we (have to) install this module in non-standard
# locations.
include(${CMAKE_CURRENT_LIST_DIR}/FindProtobufTargets.cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_package(ProtobufTargets)

# The gRPC::grpc_cpp_plugin target is sometimes defined, but without a
# IMPORTED_LOCATION
Expand Down
5 changes: 3 additions & 2 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
# limitations under the License.
# ~~~

include("${CMAKE_CURRENT_LIST_DIR}/FindProtobufTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/FindgRPC.cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_package(ProtobufTargets)
find_package(gRPC)

include("${CMAKE_CURRENT_LIST_DIR}/googleapis-targets.cmake")

Expand Down

0 comments on commit 7f63ce1

Please sign in to comment.