[CMake] Backup copy on install?

Bill Hoffman bill.hoffman at kitware.com
Wed Jun 10 15:15:52 EDT 2015


On 6/10/2015 12:57 PM, Chris Johnson wrote:
> Hmm.  It's a possibility.
>
> But those files are generate when I run cmake, aren't they?  So
> re-running that would tend to overwrite any custom modifications I
> made.  And I have about 350 of them.
>
That is what install(CODE ...) will do for you.  It will inject your 
code into those files and the code will stay there.  I was not 
suggesting you edit those files directly, just that you could use 
install(CODE, and look at those files to make sure it is doing what you 
want.

> I note that cmake_install.cmake simply uses the file(INSTALL ...)
> command.  How could I find the implementation of the file() command?
> Could I possibly customize that implementation?
To change the file command you would have to change the C++ of CMake. 
If you get install(CODE to work then it will work with any version of 
CMake.  If you can get your code to run just before the file(INSTALL 
then you should be good.
>
> Thanks much!


-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the CMake mailing list