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

[grpc] Use build_modules to find executable grpc_cpp_plugin #5404

Merged
merged 14 commits into from
May 5, 2021

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented May 3, 2021

Specify library name and version: grpc/1.37.0

Taken from protobuf package, this approach using build_modules will find the executable from a package in build context and also for the native one.

Approach is a bit different, exporting the build_module and using an auxiliary target... submitting for consideration.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@prince-chrismc
Copy link
Contributor

qchateau@83da72f

There a new point release of you want to cherry pick it

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
@jgsogo
Copy link
Contributor Author

jgsogo commented May 4, 2021

What is your opinion about this approach with the exec component? It is a fake component (maybe I should call it _exec?) but I cannot add these build-modules at the package level when I have already declared some components. Anyway, I prefer this approach exporting the .cmake file than creating the file from the recipe itself (like protobuf).

jgsogo and others added 2 commits May 4, 2021 08:47
Generated and committed by [Conan Center Bot](https://github.com/qchateau/conan-center-bot)
Find more updatable recipes in the [GitHub Pages](https://qchateau.github.io/conan-center-bot/)

Co-authored-by: Quentin Chateau via Conan Center Bot <quentin.chateau@gmail.com>
@conan-center-bot
Copy link
Collaborator

All green in build 5 (74029ec5b74201027e76255e09e1ecd74f07ec70):

  • grpc/1.37.1@:
    All packages built successfully! (All logs)

  • grpc/1.37.0@:
    All packages built successfully! (All logs)

@prince-chrismc
Copy link
Contributor

I like it separated since it's "cleaner" but there's a practicality of it all being in the same spot which I can live with.

The tie breaking for me is the template rendering.

protobuf dynamically counts the directories (maybe that's a little overkill)

protoc_rel_path = "{}bin/{}".format("".join(["../"] * module_folder_depth), protoc_filename)

However I'd much prefer a seperate file in the case of Qt6 is another example where content repeats many times in the same file and it depends on the options.

INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1};${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1}/Qt{0}"

@uilianries
Copy link
Member

/cc @Croydon as reviewer.

@conan-center-bot conan-center-bot merged commit 74588f1 into conan-io:master May 5, 2021
@jgsogo jgsogo deleted the grpc/grpc_cpp_plugin branch May 5, 2021 15:48
AlvaroFS pushed a commit to AlvaroFS/conan-center-index that referenced this pull request May 7, 2021
…plugin

* [google-cloud-cpp] Add library

* start to work on deps

* exclude tests, use config for CMake packages

* Add build module to find grpc_cpp_plugin

* [crc32c] Add recipe

* add crc32c dep

* update grpc

* remove, not for this PR

* [grpc] Use build_modules to find the grcp_cpp_plugin

* Update recipes/grpc/all/conanfile.py

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* grpc: add version 1.37.1 (conan-io#6)

Generated and committed by [Conan Center Bot](https://github.com/qchateau/conan-center-bot)
Find more updatable recipes in the [GitHub Pages](https://qchateau.github.io/conan-center-bot/)

Co-authored-by: Quentin Chateau via Conan Center Bot <quentin.chateau@gmail.com>

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
Co-authored-by: Quentin Chateau via Conan Center Bot <quentin.chateau@gmail.com>
Comment on lines +237 to +240
if self.options.cpp_plugin:
module_target_rel_path = os.path.join("lib", "cmake", "grpc_cpp_plugin.cmake")
self.cpp_info.components["execs"].build_modules["cmake_find_package"] = [module_target_rel_path]
self.cpp_info.components["execs"].build_modules["cmake_find_package_multi"] = [module_target_rel_path]
Copy link
Contributor

Choose a reason for hiding this comment

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

How did it pass the hooks? This folder is not in buiddirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants