[CMake] install(CODE "execute_process(COMMAND perl script.pl) and output to file

Pierre-Julien Villoud PVilloud at movea.com
Mon Jun 8 10:37:16 EDT 2009


Hi,

I am using some perl scripts to complete tasks in the install target. I have no problem launching the script , but I found myself with non working code inside the script and I don't why.

Inside my script I do that:
open( FILEHANDLE, ">file.txt" ) || die("Could not open file!");
print "opening uninstfile $uninstfile\n";
print FILEHANDLE "I need to print this in the file\n";
close(FILEHANDLE);


This code works if I launch the script from the command line, but fails from within cmake
The handle opens the file but never prints to it. I suppose there is a problem with a redirection, but I don't know what.
I really need a solution for that as my script needs to work inside and outside cmake.

Anyone can help?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090608/f99497d0/attachment.htm>


More information about the CMake mailing list