protocolbuffers / protocolbuffers/protobuf

CMake find_package requires CONFIG mode

Open
#24,771 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cmake keep open
Dominant language
C++
Stars
72k
Forks
16.3k
Avg merge
1d 17h
Merged PRs (30d)
140

Description

The FindProtobuf module has shipped with cmake since version 3.6, but it is no longer compatible with our cmake setup.

If you use module mode of find_package by typing something like:

find_package(Protobuf)

You will end up with a bad configuration and a broken build. To get this to work you must use config mode like:

find_package(Protobuf CONFIG)

which will use the cmake configs we ship with our package.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked FindProtobuf documentation and reproduce the failure using find_package(Protobuf) versus find_package(Protobuf CONFIG). Then inspect the CMake configs shipped by the package and establish a configuration path that avoids the bad configuration and broken build.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.