Merge pull request #4196 from mathstuf/cmake-private-target-sources

cmake: privately add sources to targets
This commit is contained in:
Adam Cozzette 2018-01-29 16:40:36 -08:00 committed by GitHub
commit 1681fe664b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,7 @@ function(protobuf_generate)
set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
endif()
if(protobuf_generate_TARGET)
target_sources(${protobuf_generate_TARGET} PUBLIC ${_generated_srcs_all})
target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all})
endif()
endfunction()