diff --git a/plugins/in_kafka/CMakeLists.txt b/plugins/in_kafka/CMakeLists.txt index ede0831f9f8..02e2dc786fb 100644 --- a/plugins/in_kafka/CMakeLists.txt +++ b/plugins/in_kafka/CMakeLists.txt @@ -3,5 +3,7 @@ set(src ) FLB_PLUGIN(in_kafka "${src}" ${KAFKA_LIBRARIES}) -target_include_directories(flb-plugin-in_kafka PUBLIC ${KAFKA_INCLUDEDIR}/librdkafka) +if(DEFINED KAFKA_INCLUDEDIR) + target_include_directories(flb-plugin-in_kafka PUBLIC ${KAFKA_INCLUDEDIR}/librdkafka) +endif() target_link_libraries(flb-plugin-in_kafka -lpthread) diff --git a/plugins/out_kafka/CMakeLists.txt b/plugins/out_kafka/CMakeLists.txt index 01c96529b1c..54b14fc2a67 100644 --- a/plugins/out_kafka/CMakeLists.txt +++ b/plugins/out_kafka/CMakeLists.txt @@ -5,5 +5,7 @@ set(src kafka.c) FLB_PLUGIN(out_kafka "${src}" ${KAFKA_LIBRARIES}) -target_include_directories(flb-plugin-out_kafka PUBLIC ${KAFKA_INCLUDEDIR}/librdkafka) +if(DEFINED KAFKA_INCLUDEDIR) + target_include_directories(flb-plugin-out_kafka PUBLIC ${KAFKA_INCLUDEDIR}/librdkafka) +endif() target_link_libraries(flb-plugin-out_kafka -lpthread)