Builds ok with Visual Studio but fails with nmake

I have a fortran project that has a target that involves compiling a number of modules using the Intel compiler. CMAKE_Fortran_MODULE_DIRECTORY is set to a common include directory for the target. However, I need the mod file for one of the modules to be created in a different include directory. I use set_source_files_properties to set the /module: compiler option for the source file to set the required include directory and I add the directory to the list of include directories for the target. This all works fine when building using the Visual Studio generator, however, when using the nmake generator the build fails when an attempt is made to copy the mod file from the common include directory. Does anyone have a suggestion of how to prevent the copy from the wrong location in the nmake build?

To answer my own question: for the targets that required it, I reset CMAKE_Fortran_MODULE_DIRECTORY before the target is created so that it had its own module directory and added a post build event that copied the required mod files to the common include directory.