[CMake] always execute CUSTOM_COMMAND

msk.conf at seznam.cz msk.conf at seznam.cz
Tue Aug 21 04:08:09 EDT 2007


Hi all.

I am new to CMake and I have a problem to understand dependencies in CMake.

Look at this code:

PROJECT ( test_project )
ADD_CUSTOM_COMMAND (
	OUTPUT file.txt
	COMMAND cp /etc/passwd file.txt
)
ADD_CUSTOM_TARGET ( file_target DEPENDS file.txt )
INSTALL ( FILES file.txt DESTINATION /tmp )

I need to create file "file.txt" and install it. But installation doesn't 
affect dependency, so file.txt will never be created. That file isn't c code, 
so it can't be included to any executable or library to create dependency.

What is the right syntax to create and install that file, please?

-------
Thank you,
Dusan




More information about the CMake mailing list