[CMake] How to set Overwrite or no over write in install(FILES ....)?

Eric Noulard eric.noulard at gmail.com
Mon Mar 11 08:32:42 EDT 2013


2013/3/11 hce <jupiter.hce at gmail.com>:
> Thanks Petr. I changed to use SCRIPT, it still got syntax error either.
> Please correct me what is wrong in the following statement.
>
> install(SCRIPT "
>      if (not exists "${destination}/myfile.txt")
>          install(FILES "${source}/myfile.txt" DESTINATION ${destination})
>      endif()
> ")
>
> Also, even the syntax is fixed, I am not clear how it can work. The
> install(FILES "${source}/myfile.txt" DESTINATION ${destination}) is
> basically to install ${source}/myfile.txt to %config
> "${destination}/myfile.txt" in the spec, where the check "if (not exists
> "${destination}/myfile.txt")" can be performed during installation?
>
> Appreciate correct me.

If your are using CPackRPM generator for your RPM
AND you want this particular file to be flagged as "%config" then
you should probably use CPACK_RPM_USER_FILELIST.

See: cpack --help-variable CPACK_RPM_USER_FILELIST

This is specific to CPack RPM generator.
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list