diff --git a/contrib/onelab2/CMakeLists.txt b/contrib/onelab2/CMakeLists.txt
index 8d494a81d56e0d90f5f7e8b4ea38b3156a6a2b36..689c5f188f35dd3e73f23c18c5c4cfbab6ef8ab4 100644
--- a/contrib/onelab2/CMakeLists.txt
+++ b/contrib/onelab2/CMakeLists.txt
@@ -19,7 +19,7 @@ if(NOT ENABLE_UDT)
 set(SRC
   ${SRC}
   noudt.cpp)
-endif(ENABLE_UDT)
+endif(NOT ENABLE_UDT)
 
 file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
 append_gmsh_src(contrib/onelab2 "${SRC};${HDR}")