Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong version in gRPCConfigVersion.cmake and grpc++*.pc #22982

Merged
merged 1 commit into from Jun 22, 2020

Conversation

kou
Copy link
Contributor

@kou kou commented May 18, 2020

They use PACKAGE_VERSION to generate version information but
PACKAGE_VERSION may be overridden by find_package(). For example,
-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides
PACKAGE_VERSION to 1.16.0. Because c-ares-config-version.cmake has the
following line:

set(PACKAGE_VERSION "1.16.0")

Setting PACKAGE_VERSION in version.cmake is a common CMake convention:

https://cmake.org/cmake/help/latest/command/find_package.html#version-selection

PACKAGE_VERSION

full provided version string

So we should use gRPC_CPP_VERSION not PACKAGE_VERSION to generate
gRPCConfigVersion.cmake and grpc++*.pc.

@yashykt

They use PACKAGE_VERSION to generate version information but
PACKAGE_VERSION may be overridden by find_package(). For example,
-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides
PACKAGE_VERSION to 1.16.0. Because c-ares-config-version.cmake has the
following line:

    set(PACKAGE_VERSION "1.16.0")

Setting PACKAGE_VERSION in version.cmake is a common CMake convention:

https://cmake.org/cmake/help/latest/command/find_package.html#version-selection

> PACKAGE_VERSION
>
>    full provided version string

So we should use gRPC_CPP_VERSION not PACKAGE_VERSION to generate
gRPCConfigVersion.cmake and grpc++*.pc.
Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jtattermusch
Copy link
Contributor

@veblush another Googler's LGTM please.

@veblush veblush self-requested a review June 22, 2020 16:17
@jtattermusch jtattermusch merged commit dbb39a5 into grpc:master Jun 22, 2020
@kou kou deleted the fix-cpp-version branch June 22, 2020 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/c++ release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants