[Insight-developers] [ITK + Wrapping (Python)] Wrappingclasses proposal - V.3

Karthik Krishnan Karthik.Krishnan at kitware.com
Tue Aug 2 10:12:38 EDT 2005



Benoit Regrain wrote:

>
> ----- Original Message ----- From: "William A. Hoffman" 
> <billlist at nycap.rr.com>
> To: "Benoit Regrain" <benoit.regrain at creatis.insa-lyon.fr>; "Gaetan 
> Lehmann" <gaetan.lehmann at jouy.inra.fr>
> Cc: <insight-developers at itk.org>
> Sent: Tuesday, August 02, 2005 3:13 PM
> Subject: Re: [Insight-developers] [ITK + Wrapping (Python)] 
> Wrappingclasses proposal - V.3
>
>
>>
>> You can use:
>>
>> FILE_WRITE(tmpfile)
>> EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different tempfile 
>> finalfile)
>
> I will test it
>
>>
>> Why is it a multi-pass process?   Seems like you could build up the 
>> file in a cmake
>> variable, then use CONFIGURE_FILE with one variable in it. 
>> @FILE_CONTENTS@
>> SET(FILE_CONTENTS ${FILE_CONTENTS} .....)
>
> I'm using macro to create the FILE_CONTENT. So, to do this solution, I 
> need create
> MACRO that return values, like the SET CMake command. But I don't know 
> how to
> do that :-(


I barely know what you are trying to do.. but sure you can write a macro 
to return values:

MACRO( GET_FILE_CONTENT  SOMEARG VAR )
  SET( ${VAR} ${SOMEARG} )
ENDMACRO( GET_FILE_CONTENT )

SET( SOMETHINGS "Blah" "Wah")

FOREACH( something ${SOMETHINGS} )
  GET_FILE_CONTENT( "${something}"  RETURNED_VAL )
  MESSAGE( "Argument to GET_FILE_CONTENT passed was ${something} and the 
macro returned ${RETURNED_VAL}" )
ENDFOREACH( something )

>
> Cheers
> Benoit Regrain
>
>>
>>
>> -Bill
>>
>> At 06:02 AM 8/2/2005, Benoit Regrain wrote:
>>
>>
>>
>>> ----- Original Message ----- From: "Gaetan Lehmann" 
>>> <gaetan.lehmann at jouy.inra.fr>
>>> To: "Benoit Regrain" <benoit.regrain at creatis.insa-lyon.fr>; "William 
>>> A. Hoffman" <billlist at nycap.rr.com>
>>> Cc: <insight-developers at itk.org>
>>> Sent: Tuesday, August 02, 2005 10:50 AM
>>> Subject: Re: [Insight-developers] [ITK + Wrapping (Python)] 
>>> Wrappingclasses proposal - V.3
>>>
>>>
>>>> On Tue, 02 Aug 2005 10:31:04 +0200, Benoit Regrain 
>>>> <benoit.regrain at creatis.insa-lyon.fr> wrote:
>>>>
>>>>> No, because I'm writting these files in multi-pass, using 
>>>>> FILE_WRITE with the
>>>>> APPEND flag. And due to the keep of the actual file list, it seems 
>>>>> impossible
>>>>> with the CONFIGURE_FILE command.
>>>>
>>>>
>>>> It seems to be feasible to write a temp file, and then use 
>>>> CONFIGURE_FILE to copy the temp file to a file named wrap_???.cxx
>>>> Don't you think so ?
>>>
>>> The content of a CMake command (like CONFIGURE_FILE) musn't be the 
>>> file generated by
>>> WRITE_FILE. So, it doesn't work :-(
>>> (I have tested it)
>>>
>>>
>>>
>>> Benoit Regrain 
>>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list