mfontanini / cppkafka

Modern C++ Apache Kafka client library (wrapper for librdkafka)
BSD 2-Clause "Simplified" License
587 stars 207 forks source link

Add fix for in-source build of cppkafka.h. #272

Closed psigen closed 3 years ago

psigen commented 3 years ago

This fixes an issue where cppkafka.h is being generated directly within the source directory, which causes issues on sandboxed build environments where the source directory is mounted readonly.

This PR changes the configure_file() directive to point to the cmake binary directory, and uses the install directives to move the generated file into the build output.

I also added quoting around constructed file paths that could ostensibly include spaces, to prevent any list parsing issues.

mfontanini commented 3 years ago

Sorry it took me some time to get to this. I think there was some reason why this was done this way initially, knowing it would pollute the source directory, but I don't really remember what it was (maybe allowing doing #includes directly into the source dir? I don't know).

Anyway, this is a better solution for sure. Thanks!