[CMake] Parallel builds do not work correctly when using "cmake
-E copy" to copy files
Brad King
brad.king at kitware.com
Thu Dec 13 17:07:09 EST 2007
Alan W. Irwin wrote:
> So just keeping narrowly focussed on that fragment there is only one "ALL"
> custom target and ADD_DEPENDENCIES would not help since it only works on
> targets. Thus, I doubt there is anything locally wrong with dependencies
> there. It is possible some other dependency is making a dependency pattern
> that triggers the bug, but I should know more about that when I have a
> simpler example that triggers the bug (or not).
I was able to reproduce the problem with the code below. It is fixed by
uncommenting the ADD_DEPENDENCIES line. You must be putting those
output files into another target that does not depend on the
tcl_examples target. Perhaps the make_documentation target?
-Brad
PROJECT(FOO)
FOREACH(f f1 f2 f3 f4 f5 f6 f7 f8 f9)
LIST(APPEND DEPS ${FOO_BINARY_DIR}/${f})
ADD_CUSTOM_COMMAND(OUTPUT ${FOO_BINARY_DIR}/${f}
COMMAND echo ${f} > ${FOO_BINARY_DIR}/${f}
)
ENDFOREACH(f)
ADD_CUSTOM_TARGET(examples ALL DEPENDS ${DEPS})
ADD_CUSTOM_TARGET(examples2 ALL DEPENDS ${DEPS})
#ADD_DEPENDENCIES(examples2 examples)
More information about the CMake
mailing list