--- a/external/pw2qmcpack/CMakeLists.txt
+++ b/external/pw2qmcpack/CMakeLists.txt
@@ -47,6 +47,7 @@
 qe_add_library(pw2qmcpack_esh5 src/esh5_interfaces.c)
 target_compile_definitions(pw2qmcpack_esh5 PUBLIC "H5_USE_16_API;__HDF5_C")
 target_link_libraries(pw2qmcpack_esh5 PRIVATE pw2qmcpack_hdf5_c pw2qmcpack_mpi_c)
+set_target_properties(pw2qmcpack_esh5 PROPERTIES Fortran_MODULE_DIRECTORY "")
 
 set(sources src/pw2qmcpack.f90)
 qe_add_executable(pw2qmcpack_exe ${sources})
