diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index d6f802e8a06bb79859b7d60ee556c99405babef0..760221b124439a5ed7835d2ce2073deb0ab2a583 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -9,7 +9,6 @@
 # resulting memory leaks are not logged by valgrind anyway.  Therefore, we
 # don't have to exclude it.
 
-set(CTEST_CUSTOM_MEMCHECK_IGNORE
-  ${CTEST_CUSTOM_MEMCHECK_IGNORE}
+list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
   kwsys.testProcess-10
   )