diff --git a/src/pystencils_autodiff/CMakeLists.tmpl.txt b/src/pystencils_autodiff/CMakeLists.tmpl.txt
index 062647cae19db52c6fc83163c6870edd18a817f6..99fc680a506d816f66c98b2862634c09ce1aecb4 100644
--- a/src/pystencils_autodiff/CMakeLists.tmpl.txt
+++ b/src/pystencils_autodiff/CMakeLists.tmpl.txt
@@ -5,6 +5,6 @@ waLBerla_add_executable ( NAME {{ cmake_target_name }}
                                 {%- endfor %}
                           DEPENDS {{depends | join(' ')}})
 
-{% if 'walberla_openvdb' in depends %}
+{% if 'walberla_openvdb' in depends -%}
 target_link_libraries( {{ cmake_target_name }} tbb boundary openvdb Half IexMath Iex IlmThread Imath)
-{% endif %}
+{%- endif %}