Skip to content

Commit

Permalink
Use CMakePackageConfigHelpers to generate version file
Browse files Browse the repository at this point in the history
The version file that already existed looks like it was generated
by this module. Replace it with proper usage of the module.
  • Loading branch information
KyleFromKitware committed Oct 25, 2019
1 parent 14055e2 commit 0f2ad2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
11 changes: 0 additions & 11 deletions cmake/gRPCConfigVersion.cmake.in

This file was deleted.

19 changes: 12 additions & 7 deletions templates/CMakeLists.txt.template
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,18 @@
)
endif()

foreach(_config gRPCConfig gRPCConfigVersion)
configure_file(cmake/<%text>${_config}</%text>.cmake.in
<%text>${_config}</%text>.cmake @ONLY)
install(FILES <%text>${CMAKE_CURRENT_BINARY_DIR}/${_config}</%text>.cmake
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
)
endforeach()
include(CMakePackageConfigHelpers)

configure_file(cmake/gRPCConfig.cmake.in
gRPCConfig.cmake @ONLY)
write_basic_package_version_file(<%text>${CMAKE_CURRENT_BINARY_DIR}/</%text>gRPCConfigVersion.cmake
VERSION <%text>${PACKAGE_VERSION}</%text>
COMPATIBILITY AnyNewerVersion)
install(FILES
<%text>${CMAKE_CURRENT_BINARY_DIR}/</%text>gRPCConfig.cmake
<%text>${CMAKE_CURRENT_BINARY_DIR}/</%text>gRPCConfigVersion.cmake
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
)

install(FILES <%text>${CMAKE_CURRENT_SOURCE_DIR}/etc/roots.pem</%text>
DESTINATION <%text>${gRPC_INSTALL_SHAREDIR}</%text>)
Expand Down

0 comments on commit 0f2ad2a

Please sign in to comment.