Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 620940a

Browse files
committed
Fix installation path for protos.
1 parent eab5cb5 commit 620940a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ install(TARGETS ${googleapis_cpp_installed_libraries_list}
267267

268268
foreach (target ${googleapis_cpp_installed_libraries_list})
269269
google_cloud_cpp_install_proto_library_headers("${target}")
270-
google_cloud_cpp_install_proto_library_protos("${target}")
270+
google_cloud_cpp_install_proto_library_protos("${target}" "${GOOGLEAPIS_CPP_SOURCE}")
271271
endforeach ()
272272

273273
# Export the CMake targets to make it easy to create configuration files.

cmake/CompileProtos.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,22 +221,22 @@ function (google_cloud_cpp_install_proto_library_headers target)
221221
endfunction ()
222222

223223
# Install protos for a C++ proto library.
224-
function (google_cloud_cpp_install_proto_library_protos target)
224+
function (google_cloud_cpp_install_proto_library_protos target strip_prefix)
225225
get_target_property(target_protos ${target} PROTO_SOURCES)
226-
foreach (header ${target_protos})
226+
foreach (proto ${target_protos})
227227
# Skip anything that is not a header file.
228-
if (NOT "${header}" MATCHES "\\.proto$")
228+
if (NOT "${proto}" MATCHES "\\.proto$")
229229
continue()
230230
endif ()
231-
string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/"
232-
""
233-
relative
234-
"${header}")
231+
string(REPLACE "${strip_prefix}/"
232+
""
233+
relative
234+
"${proto}")
235235
get_filename_component(dir "${relative}" DIRECTORY)
236236
# This is modeled after the Protobuf library, it installs the basic
237237
# protos (think google/protobuf/any.proto) in the include directory for
238238
# C/C++ code. :shrug:
239-
install(FILES "${header}" DESTINATION
239+
install(FILES "${proto}" DESTINATION
240240
"${CMAKE_INSTALL_INCLUDEDIR}/${dir}")
241241
endforeach ()
242242
endfunction ()

0 commit comments

Comments
 (0)