-
Notifications
You must be signed in to change notification settings - Fork 374
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
refactor(cmake): use template for config.cmake.in #12487
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #12487 +/- ##
=======================================
Coverage 93.62% 93.62%
=======================================
Files 2039 2039
Lines 180677 180677
=======================================
+ Hits 169150 169151 +1
+ Misses 11527 11526 -1 ☔ View full report in Codecov by Sentry. |
cmake/GoogleCloudCppLibrary.cmake
Outdated
@@ -57,6 +59,11 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name) | |||
endif () | |||
set(DOXYGEN_EXCLUDE_SYMBOLS "internal") | |||
set(DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/quickstart") | |||
unset(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting with CMake 3.12 we can use list(TRANSFORM ...)
:
https://cmake.org/cmake/help/latest/command/list.html#transform
set(GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES "${opt_CROSS_LIB_DEPS}")
list(TRANSFORM
GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES
PREPEND "${PROJECT_BINARY_DIR}/google/cloud/")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, nice. Done.
cmake/GoogleCloudCppLibrary.cmake
Outdated
@@ -201,7 +208,16 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name) | |||
|
|||
# Create and install the CMake configuration files. | |||
include(CMakePackageConfigHelpers) | |||
configure_file("config.cmake.in" "${library_target}-config.cmake" @ONLY) | |||
set(GOOGLE_CLOUD_CPP_CONFIG_LIBRARY "${library_target}") | |||
unset(find_dependencies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but I am skeptical as to whether this one was an improvement. I briefly explored list(TRANSFORM ... REPLACE ...)
, but gave up.
Part of the work for #12483. Also related to #12428 and #12467.
Add explicit support to the client library helper to handle cross library deps. This also cleans up the passing of
GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES
from the${library}/CMakeLists.txt
as a global. (Of course we later pass it as a global to our doxygen helper functions, but 🤫 )This also introduces a
config.cmake.in
template and lets us remove 100+ identical${library}/config.cmake.in
files.I plan to update the scaffolding in a follow up. And I might update handwritten libraries like
bigtable
,pubsub
,spanner
which have identicalconfig.cmake.in
's to the template.This change is