Merge pull request #14907 from mkruskal-google/cmake-install-fix

Only substitute prefixes during installation setup.
pull/15360/head
zhangskz 1 year ago committed by GitHub
commit 59eebe3e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cmake/install.cmake

@ -78,7 +78,10 @@ foreach(_header ${protobuf_HEADERS})
elseif (_find_nosrc GREATER -1)
set(_from_dir "${protobuf_SOURCE_DIR}")
endif()
string(REPLACE "${_from_dir}" "" _header ${_header})
# On some platforms `_form_dir` ends up being just "protobuf", which can
# easily match multiple times in our paths. We force it to only replace
# prefixes to avoid this case.
string(REGEX REPLACE "^${_from_dir}" "" _header ${_header})
get_filename_component(_extract_from "${_from_dir}/${_header}" ABSOLUTE)
get_filename_component(_extract_name ${_header} NAME)
get_filename_component(_extract_to "${CMAKE_INSTALL_INCLUDEDIR}/${_header}" DIRECTORY)

Loading…
Cancel
Save