Skip to content

Commit f91cbd6

Browse files
committed
Due to changes in commonbuildparameters protobuf .h files were not installed to the correct location
1 parent 26a4bde commit f91cbd6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

cmake/functions.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ endif()
8787
function(add_proto_library NAME)
8888
set(SOURCES "")
8989
set(HEADERS "")
90-
set(PB_REL_PATH "")
9190

9291
foreach(PROTO IN ITEMS ${ARGN})
9392
compile_proto_to_cpp(H C PB_REL_PATH ${PROTO})
@@ -110,14 +109,14 @@ function(add_proto_library NAME)
110109
# target_include_directories(${NAME} PUBLIC
111110
# ${CMAKE_BINARY_DIR}/generated/
112111
# )
112+
install(TARGETS ${NAME} EXPORT supergeniusTargets)
113+
113114
foreach(H IN ITEMS ${HEADERS})
114-
set_target_properties(${NAME} PROPERTIES PUBLIC_HEADER "${H}")
115+
file(RELATIVE_PATH H_REL_PATH "${CMAKE_BINARY_DIR}/generated" "${H}")
116+
get_filename_component(H_REL_DIR "${H_REL_PATH}" DIRECTORY)
117+
install(FILES "${H}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${H_REL_DIR}")
115118
endforeach()
116119

117-
install(TARGETS ${NAME} EXPORT supergeniusTargets
118-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PB_REL_PATH}
119-
)
120-
121120
disable_clang_tidy(${NAME})
122121

123122
add_dependencies(generated ${NAME})

0 commit comments

Comments
 (0)