[CMake] how to replace text in generated files

Andy Cedilnik andy.cedilnik at kitware.com
Mon Mar 21 16:53:10 EST 2005


Hi Alex,

In 2.0 this was sort of experimental feature used for install, so it was
not documented. It turned out to work just fine, so it can be used with
no problem. You just have to make sure not to use generators.

       Andy

Alexander Neundorf wrote:

>>Hi Alex, 
>> 
>>What you can do is to write a cmake script that does what you want it 
>>    
>>
>to 
>  
>
>>do. Then you call it during build stage using: 
>> 
>>ADD_CUSTOM_COMMAND(... 
>>... 
>>${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/my_fancy_script.cmake 
>>...) 
>> 
>>       Andy 
>>    
>>
> 
>Works ! :-) 
>Using -DSOME_VAR:STRING="blah" I can feed the filenames into the extra 
>script files :-) 
>Did I mention that cmake rules ? 
> 
>Bye 
>Alex 
> 
>P.S. the -P option doesn't appear in the man-page 
> 
>
>  
>


-- 
Andy Cedilnik
Kitware Inc.



More information about the CMake mailing list