[CMake] How to associate a command with a auto-generated target?

Óscar Fuentes ofv at wanadoo.es
Mon Nov 10 15:48:05 EST 2008


Hello, Alex.

Alexander Neundorf <a.neundorf-work at gmx.net>
writes:

>> I wish to execute a command when the `clean' target is invoked. That is,
>> my command shall execute on addition of the normal target action.
>
> Doesn't work, you have to do it the other way round: create a custom target 
> my-special-clean, do what you need, and also execute something like 
> ${CMAKE_MAKE_COMMAND} <directories etc> clean

Sadly, this is not acceptable. People complain about having to learn
cmake and I want to avoid giving them a reason for complaining about
having to learn project-specific ways of doing standard things.

BTW, CMAKE_MAKE_COMMAND is not listed on --help-variables. You mean
CMAKE_BUILD_TOOL, don't you?

-- 
Oscar



More information about the CMake mailing list