On Thu, May 28, 2009 at 10:22:16AM -0400, Dong Tiger wrote: > The problem I ran into when using add_custom_command is that C files will be > compiled before foo.h is generated and the compilation will fail.
Sounds like you need to add_dependencies(C_target foo.h_custom_target). > > If your custom_target() has correct OUTPUT and DEPENDS parameters, this > > should not happen. Are you specifying ALL in your add_custom_target()? > > The manual doesn't mention OUTPUT can be specified in add_custom_target. And > it reads that "(The target) is ALWAYS CONSIDERED OUT OF DATE even if the > commands try to create a file with the name of the target.". Yes I was mixing custom_command with custom_target. Since you have an OUTPUT (foo.h) you must have a custom_command, right? I think what that ALWAYS OUT OF DATE scary warning means is that the target will always be "visited" by CMake. The OUTPUT is not regenerated unless one of the DEPENDS changes -- I do this a lot and it works well for my projects. tyler _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
