Re: [CMake] Execute_process with wildcard characters

2007-08-01 Thread Philippe Fremy
Bill Hoffman wrote:
 FILE(GLOB_RECURSE variable [RELATIVE path])
 FILE(REMOVE [file1 ...])

While we are on this topic, I found something missing from the FILE
command: the ability to rename a file or a directory. I need just this
for one of my programs and it's missing.

I tried to add it as a feature request but the bugtracker seems locked,
probably because of the spam problems.

Philippe

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Execute_process with wildcard characters

2007-07-31 Thread Bill Hoffman

Ajay Divekar wrote:

I want to execute the following command using EXECUTE_PROCESS.

EXECUTE_PROCESS( COMMAND rm -vf  */*.*~ RESULT_VARIABLE ret_var)

I have some abc.txt~ files.

The result variable shows 0 as its value, signifying that the command has been 
executed properly. The above mentioned files still exists.


Thanks for your advice in advance.
  

You should change it to do:
EXECUTE_PROCESS( COMMAND rm -rf  /* RESULT_VARIABLE ret_var)

:-)

Only kidding

The problem is that you are running rm without a shell.   The shell is 
the one that
expands the */*.~ stuff and passes the expanded list to rm.   So, this 
might work:


EXECUTE_PROCESS( COMMAND sh rm -vf  */*.*~ RESULT_VARIABLE ret_var)

To be more portable, you should look at the FILE command.
Specifically these two options:

FILE(GLOB_RECURSE variable [RELATIVE path])
FILE(REMOVE [file1 ...])


-Bill





___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake