On 11/06/2010 06:50 AM, SK wrote: > On Fri, Nov 5, 2010 at 1:04 PM, Alan W. Irwin <ir...@beluga.phys.uvic.ca> > wrote: >> I agree the above idea should work, but dropping add_custom_command >> completely and moving the COMMAND to add_custom_target instead (and >> dropping all file DEPENDS for the custom target) is even a simpler way >> to insure COMMAND gets executed every time the custom target is >> built. > > Yes it always runs, but there is no "output" from add_custom_target. > When the external makefile produces an output needed by some larger > dependency chain, then add_custom_command is the only way.
If you want to ensure that an output-producing custom command without dependencies runs each time its output - present or not - is referred to you might use a second, say, dummy output which never exists, e.g.: ADD_CUSTOM_COMMAND( OUTPUT <xyz build directory>/libxyz.so dummy COMMAND make WORKING_DIRECTORY <xyz build directory> ) Thus, there is no need for a triggering custom target unless the, say, productive output is referenced from another CMakeLists.txt. Regards, Michael _______________________________________________ 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