diff --git a/utils/nightly/gmsh.ctest b/utils/nightly/gmsh.ctest
index 93422cb6921d3cc028caa22dc0083ec33f47169a..e727ea860822b660137636e3b7f0f23586d82be9 100644
--- a/utils/nightly/gmsh.ctest
+++ b/utils/nightly/gmsh.ctest
@@ -26,9 +26,6 @@ set(CTEST_UPDATE_COMMAND "${CTEST_SVN_COMMAND}")
 set(CTEST_CONFIGURE_COMMAND 
     "${CTEST_CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_BUILD_OPTIONS}")
-if(BUILD_DYNAMIC)
-  set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DENABLE_BUILD_DYNAMIC=1")
-endif(BUILD_DYNAMIC)
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-G${CTEST_CMAKE_GENERATOR}\"")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")
 
diff --git a/utils/nightly/gmsh_linux64.ctest b/utils/nightly/gmsh_linux64.ctest
index 3edb9aa14663dbe672c1a95249edaeae7f1c817b..3c3654058f8775752fb569f280e4dac79ee98241 100644
--- a/utils/nightly/gmsh_linux64.ctest
+++ b/utils/nightly/gmsh_linux64.ctest
@@ -26,7 +26,7 @@ set(OPT "${OPT} -DPETSC_ARCH=linux_complex_mumps_seq")
 set(OPT "${OPT} -DPETSC_DIR=$ENV{HOME}/src/petsc-3.1-p8")
 set(OPT "${OPT} -DSLEPC_DIR=$ENV{HOME}/src/slepc-3.1-p4")
 if(BUILD_DYNAMIC)
-  set(OPT "${OPT} -DENABLE_WRAP_PYTHON=1")
+  set(OPT "${OPT} -DENABLE_BUILD_DYNAMIC=1 -DENABLE_WRAP_PYTHON=1")
 endif(BUILD_DYNAMIC)
 set(CTEST_BUILD_OPTIONS ${OPT})
 include(gmsh.ctest)
diff --git a/utils/nightly/gmsh_mac.ctest b/utils/nightly/gmsh_mac.ctest
index 9d638b6e38a9dd663ce8c4445ee608fd9524ce89..7d9db85f51e0a8a226890e78a2070371cae8a00f 100644
--- a/utils/nightly/gmsh_mac.ctest
+++ b/utils/nightly/gmsh_mac.ctest
@@ -27,7 +27,7 @@ set(OPT "${OPT} -DPETSC_ARCH=macosx_complex_mumps_seq")
 set(OPT "${OPT} -DPETSC_DIR=$ENV{HOME}/src/petsc-3.1-p8")
 set(OPT "${OPT} -DSLEPC_DIR=$ENV{HOME}/src/slepc-3.1-p6")
 if(BUILD_DYNAMIC)
-  set(OPT "${OPT} -DENABLE_WRAP_PYTHON=1")
+  set(OPT "${OPT} -DENABLE_BUILD_DYNAMIC=1 -DENABLE_WRAP_PYTHON=1")
   set(OPT "${OPT} -DENABLE_OS_SPECIFIC_INSTALL=0")
 endif(BUILD_DYNAMIC)
 set(CTEST_BUILD_OPTIONS ${OPT})
diff --git a/utils/nightly/gmsh_win64.ctest b/utils/nightly/gmsh_win64.ctest
index 38142173966f87bee020b82bc795cdecd0638926..86c684fa7f8bb86a11b4a6d8d36d5a90b21c59ab 100644
--- a/utils/nightly/gmsh_win64.ctest
+++ b/utils/nightly/gmsh_win64.ctest
@@ -28,6 +28,9 @@ set(OPT "${OPT} -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe")
 set(OPT "${OPT} -DPETSC_ARCH=win64_complex_mumps_seq")
 set(OPT "${OPT} -DPETSC_DIR=$ENV{HOME}/src/petsc-3.1-p8")
 set(OPT "${OPT} -DSLEPC_DIR=$ENV{HOME}/src/slepc-3.1-p6")
+if(BUILD_DYNAMIC)
+  set(OPT "${OPT} -DENABLE_BUILD_DYNAMIC=1")
+endif(BUILD_DYNAMIC)
 set(CTEST_BUILD_OPTIONS ${OPT})
 include(gmsh.ctest)
 if(BUILD_DYNAMIC)