There is following sequence: ADD_EXECUTEABLE(generator gen.c) ADD_CUSTOM_COMMAND(OUTPUT tlib.h COMMAND generator > tlib.h) ADD_LIBRARY(tlib tlib.c tlib.h) The question: Is it sure that ADD_EXECUTEABLE is invoked before the library is build or is here an ADD_DEPENDENCIES(tlib generator) necessary? Greetings Micha