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

2013-03-12 Thread jupiter
Thanks Eric. That clarifies lots of things. Kind regards, Jupiter On 3/11/13, Eric Noulard eric.noul...@gmail.com wrote: 2013/3/11 hce jupiter@gmail.com: Andreas Stahl wrote Hello Jupiter, can you post the error message here? I wasn't aware that install(FILES ...) did any checking

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

2013-03-11 Thread Petr Kmoch
Hi Jupiter, regarding your second question: you'd need to escape the nested quotes. Also, I'm not sure if 'not exists' can be given in lowercase. However, I'd strongly suggest using install(SCRIPT ...) instead of install(CODE ...), precisely because of the escaping issues. Petr On Mon, Mar 11,

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

2013-03-11 Thread hce
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

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

2013-03-11 Thread Petr Kmoch
install(SCRIPT ...) takes a name of a file as an argument, and executes the CMake code in the file at installation time. That's why you don't have to care about escaping there. How this works is that the code in the file (or the code you give to install(CODE ...)) is injected into

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

2013-03-11 Thread Andreas Stahl
Am 11.03.2013 um 06:14 schrieb hce: Hi, I have following statement to install a file from source directory to destination. It got a conflict error if the destination has already had the file. Hello Jupiter, can you post the error message here? I wasn't aware that install(FILES ...) did

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

2013-03-11 Thread hce
Andreas Stahl wrote Hello Jupiter, can you post the error message here? I wasn't aware that install(FILES ...) did any checking besides comparing the dates and overwriting if the file to be installed is newer. Also, you misunderstood what Petr meant. You need to escape the quotes in the

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

2013-03-11 Thread Eric Noulard
2013/3/11 hce jupiter@gmail.com: Andreas Stahl wrote Hello Jupiter, can you post the error message here? I wasn't aware that install(FILES ...) did any checking besides comparing the dates and overwriting if the file to be installed is newer. Also, you misunderstood what Petr meant. You

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

2013-03-10 Thread hce
Hi, I have following statement to install a file from source directory to destination. It got a conflict error if the destination has already had the file. install(FILES ${source}/myfile.txt DESTINATION ${destination}) Is there anyway to set either overwrite, or no overwrite if the file