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

Consider using a template for GAPIC's config.cmake.in #12483

Closed
dbolduc opened this issue Aug 28, 2023 · 0 comments · Fixed by #12779
Closed

Consider using a template for GAPIC's config.cmake.in #12483

dbolduc opened this issue Aug 28, 2023 · 0 comments · Fixed by #12779
Labels
type: cleanup An internal cleanup or hygiene concern.

Comments

@dbolduc
Copy link
Member

dbolduc commented Aug 28, 2023

A follow up to #12428 (our cmake yak has more hair)

These config.cmake.in files are basically all the same. The only difference is the name of the library, and some of them have extra dependencies. (e.g. asset must find_dependency(osconfig) and others).

#12482 has an example showing what this work would probably look like:

set(GOOGLE_CLOUD_CPP_CONFIG_LIBRARY "${library}")
configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/config.cmake.in"
"google_cloud_cpp_${library}-config.cmake" @ONLY)

https://github.com/googleapis/google-cloud-cpp/blob/d5382a01e480c6dd58b31e670472381425c5dcb4/cmake/templates/config.cmake.in


The gain is one less file per library created by the scaffolding and manually maintained by hand. (not that these change often)


Categories of Libraries that do not perfectly match the template

Cross library dependencies (in GA libraries):

  • asset -> accesscontextmanager, osconfig
  • binaryauthorization, containeranalysis -> grafeas
  • contentwarehouse -> documentai

Non-standard *-targets.cmake file name.

  • pubsub
  • spanner

REST-based (and weird, anyways):

  • storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant