[CMake] Problem with Visual Studio, custom commands, and dependencies. Bug?

Jensen, Erik A Erik.Jensen at pnnl.gov
Wed May 9 15:04:34 EDT 2012


Part of my build involves generating an archive of several files. To do this, I have custom commands for copying each file into a directory (some from the source tree, some from the build tree), a custom command for generating the archive, and a custom target that depends on the latter custom command. Each copy command depends on its source file, and the archive command depends on all of the destination files.

This works fine with NMake files, but I have noticed a problem with Visual Studio 2010 solution files: when I modify a source file and build, the command to copy the file into the directory is run, but the command to build the archive is not run unless I run build a second time. It seems that Visual Studio checks the dependencies for the archive command before running the copy commands, so it doesn't pick up the changed files until a subsequent run.

Is this a known limitation, or a bug in the generated files? It seems like it could be solved in this case by also including dependencies of dependencies in the generated project files, but I haven't thought about it enough to know if that would cause other problems.

Thanks.
-- Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120509/6ffd0803/attachment.htm>


More information about the CMake mailing list