[CMake] hook __EOF__

Michael Wild themiwi at gmail.com
Mon Aug 15 04:30:48 EDT 2011


On Mon 15 Aug 2011 10:12:59 AM CEST, t m wrote:
> Hi All,
> 
> I guess it's not commonly used feature. Does anyone who knows a code
> of cmake a bit can provide information if that's possible at all?
> 
> Thanks, T Majchrowski.
> 
> 
> 2011/8/11 t m <cmake at majchrowski.co.uk>:
>> Hi All,
>>
>> Is it possible to register hook function that will be called at the
>> end of processinf of CMakeLists.txt:
>> Example CMakeLists.txt
>>
>>
>> 0:cmake_minimum_required( VERSION 2.6 )
>> 1:project( foo.project)
>> 2:
>> 3: add_subdirectory( example )
>> 4:
>> ...
>> N: <-- last line of CMakeLists.txt this will trigger to call other funcion.
>>
>>
>> I mean something simillar like variable_watch but the trigger will be
>> __EOF__ CMakeLists.txt file not a variable (e.g. eof_watch)

No, it's not possible, and I don't see any Plugin-Hook you could use 
for that (others might correct me, though). The only way around this is 
to place the function call at the end of every CMakeLists.txt file 
manually.

Michael


More information about the CMake mailing list