[Insight-users] Fwd: CMake to set up resources for executables on OSX ?

Jon Harald Kaspersen Jon.H.Kaspersen@unimed.sintef.no
Mon, 20 Jan 2003 13:44:02 +0100


--Apple-Mail-12-334933356
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	delsp=yes;
	charset=ISO-8859-1;
	format=flowed



Begin forwarded message:

> From: Jon Harald Kaspersen <jonk@sintef.no>
> Date: Mon Jan 20, 2003  1:43:13 PM Europe/Oslo
> To: Bill Hoffman <bill.hoffman@kitware.com>
> Subject: Re: CMake to set up resources for executables on OSX ?
>
> Hi again Bill,
>
> I am having problems with :
>
> IF(APPLE)
> =A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)
> ENDIF(APPLE)
>
> CMake Error: Error in cmake code at
> /Users/jonk/cvs/Insight/Applications/CMakeLists.txt:8:
>
> Line 8 in /Users/jonk/cvs/Insight/Applications/CMakeLists.txt is:
> =A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)
>
> I am running the latest CVS of CMake.
>
> Any suggestions ?
>
> Regards
> Jon
>
> On Friday, January 17, 2003, at 03:28 PM, Bill Hoffman wrote:
>
>> Note quite.=A0=A0 The VTK_APPLE_RESOURCE is defined in the =
FIND_PROGRAM =20
>> command.
>> So, you can just change the name to ITK_APPLE_RESOURCE.
>>
>> The custom command must be done for each executable that you want to =20=

>> run
>> the resource program on.=A0=A0
>>
>>
>> So, for RegionGrowingSegmentation , you would do this:
>>
>> IF(APPLE)
>> =A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)
>> =A0 IF(ITK_APPLE_RESOURCE)
>> =A0=A0=A0 ADD_CUSTOM_COMMAND(
>> =A0=A0=A0=A0=A0 SOURCE RegionGrowingSegmentation
>> =A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}
>> =A0=A0=A0=A0=A0 ARGS -t APPL /usr/local/include/FL/mac.r -o =20
>> ${EXECUTABLE_OUTPUT_PATH}/RegionGrowingSegmentation
>> =A0=A0=A0=A0=A0 TARGET RegionGrowingSegmentation
>> =A0=A0=A0=A0=A0 )
>> =A0 ENDIF(ITK_APPLE_RESOURCE)
>> ENDIF(APPLE)
>>
>>
>> I guess the FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools) =20
>> could
>> be in the top CMakeLists.txt file for the Applications directory, and
>> then used by each application.
>>
>> With CMake 1.6 we could use a macro to make this a bit shorter.
>> Why don't you try and see if it works, and when we get it working we
>> can create the macro.=A0=A0 Cmake 1.6 should be out of beta soon, and =
we
>> can then use Macros in the ITK files.
>>
>> -Bill
>>
>> -Bill
>>
>> At 03:11 PM 1/17/2003 +0100, Jon Harald Kaspersen wrote:
>>
>> Bill,
>>
>> So, I will have to add something like this to my CMakeLists.txt file =20=

>> in Insight/Applications/ directory :
>>
>> Is there a ITK_APPLE_RESOURCE parameter in CMake ?
>>
>> IF(APPLE)
>> =A0 FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
>> =A0 IF(VTK_APPLE_RESOURCE)
>> =A0=A0=A0 ADD_CUSTOM_COMMAND(
>> =A0=A0=A0=A0=A0 SOURCE itk
>> =A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}
>> =A0=A0=A0=A0=A0 ARGS -t APPL /usr/local/include/FL/mac.r -o =20
>> ${EXECUTABLE_OUTPUT_PATH}
>> =A0=A0=A0=A0=A0 TARGET itk
>> =A0=A0=A0=A0=A0 )
>> =A0 ENDIF(VTK_APPLE_RESOURCE)
>> ENDIF(APPLE)
>>
>>
>> Regards
>> Jon
>>
>> On Friday, January 17, 2003, at 02:54 PM, Bill Hoffman wrote:
>>
>> Yes, this can be done, and is being done in VTK, here is
>> what the code looks like in VTK:
>>
>>
>> IF(VTK_USE_CARBON)
>> =A0 FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
>> =A0 IF(VTK_APPLE_RESOURCE)
>> =A0=A0=A0 ADD_CUSTOM_COMMAND(
>> =A0=A0=A0=A0=A0 SOURCE vtk
>> =A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}
>> =A0=A0=A0=A0=A0 ARGS Carbon.r -o ${EXECUTABLE_OUTPUT_PATH}/vtk
>> =A0=A0=A0=A0=A0 TARGET vtk
>> =A0=A0=A0=A0=A0 )
>> =A0 ENDIF(VTK_APPLE_RESOURCE)
>> ENDIF(VTK_USE_CARBON)
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>> Jon Harald Kaspersen=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0Tel: =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 73 59 75 =20
>> 89
>> Ph.D. Mechanical Engineering=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Mob:=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 93 03 65 =20
>> 90
>> Senior Scientist=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Pager=A0=A0=A0+47 96 84 29 =20
>> 94
>> SINTEF Unimed - Ultralyd=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
Fax: =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 73 59 78 =20
>> 73
>> N-7465 Trondheim
>> NORWAY=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0e-mail:=A0J=
on.H.Kaspersen@unimed.sintef.no
>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0WEB:=A0=A0=A0=A0http://=20
>> www.us.unimed.sintef.no/
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>>
>> </blockquote></x-html>
>>
>>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
> Jon Harald Kaspersen			Tel: 		+47 73 59 75 89
> Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90
> Senior Scientist				Pager	+47 96 84 29 94
> SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73
> N-7465 Trondheim
> NORWAY			e-mail:	Jon.H.Kaspersen@unimed.sintef.no
> 				WEB:	http://www.us.unimed.sintef.no/
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
Jon Harald Kaspersen			Tel: 		+47 73 59 75 89
Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90
Senior Scientist				Pager	+47 96 84 29 94
SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73
N-7465 Trondheim
NORWAY			e-mail:	Jon.H.Kaspersen@unimed.sintef.no
				WEB:	http://www.us.unimed.sintef.no/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D

--Apple-Mail-12-334933356
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=ISO-8859-1




Begin forwarded message:


<excerpt><bold>From: </bold>Jon Harald Kaspersen <<jonk@sintef.no>

<bold>Date: </bold>Mon Jan 20, 2003  1:43:13 PM Europe/Oslo

<bold>To: </bold>Bill Hoffman <<bill.hoffman@kitware.com>

<bold>Subject: </bold>Re: CMake to set up resources for executables on
OSX ?


Hi again Bill,


I am having problems with :


IF(APPLE)

=A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)

ENDIF(APPLE)


CMake Error: Error in cmake code at

/Users/jonk/cvs/Insight/Applications/CMakeLists.txt:8:


Line 8 in /Users/jonk/cvs/Insight/Applications/CMakeLists.txt is:

=A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)


I am running the latest CVS of CMake.


Any suggestions ?


Regards

Jon


On Friday, January 17, 2003, at 03:28 PM, Bill Hoffman wrote:


<excerpt>Note quite.=A0=A0 The VTK_APPLE_RESOURCE is defined in the
FIND_PROGRAM command.

So, you can just change the name to ITK_APPLE_RESOURCE.


The custom command must be done for each executable that you want to
run

the resource program on.=A0=A0



So, for RegionGrowingSegmentation , you would do this:


IF(APPLE)

=A0 FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)

=A0 IF(ITK_APPLE_RESOURCE)

=A0=A0=A0 ADD_CUSTOM_COMMAND(

=A0=A0=A0=A0=A0 SOURCE RegionGrowingSegmentation

=A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}

=A0=A0=A0=A0=A0 ARGS -t APPL /usr/local/include/FL/mac.r -o
${EXECUTABLE_OUTPUT_PATH}/RegionGrowingSegmentation

=A0=A0=A0=A0=A0 TARGET RegionGrowingSegmentation

=A0=A0=A0=A0=A0 )

=A0 ENDIF(ITK_APPLE_RESOURCE)

ENDIF(APPLE)



I guess the FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools) could

be in the top CMakeLists.txt file for the Applications directory, and

then used by each application.


With CMake 1.6 we could use a macro to make this a bit shorter.

Why don't you try and see if it works, and when we get it working we

can create the macro.=A0=A0 Cmake 1.6 should be out of beta soon, and we

can then use Macros in the ITK files.


-Bill


-Bill


At 03:11 PM 1/17/2003 +0100, Jon Harald Kaspersen wrote:


Bill,


So, I will have to add something like this to my CMakeLists.txt file
in Insight/Applications/ directory :


Is there a ITK_APPLE_RESOURCE parameter in CMake ?


IF(APPLE)

=A0 FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)

=A0 IF(VTK_APPLE_RESOURCE)

=A0=A0=A0 ADD_CUSTOM_COMMAND(

=A0=A0=A0=A0=A0 SOURCE itk

=A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}

=A0=A0=A0=A0=A0 ARGS -t APPL /usr/local/include/FL/mac.r -o
${EXECUTABLE_OUTPUT_PATH}

=A0=A0=A0=A0=A0 TARGET itk

=A0=A0=A0=A0=A0 )

=A0 ENDIF(VTK_APPLE_RESOURCE)

ENDIF(APPLE)



Regards

Jon


On Friday, January 17, 2003, at 02:54 PM, Bill Hoffman wrote:


Yes, this can be done, and is being done in VTK, here is

what the code looks like in VTK:



IF(VTK_USE_CARBON)

=A0 FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)

=A0 IF(VTK_APPLE_RESOURCE)

=A0=A0=A0 ADD_CUSTOM_COMMAND(

=A0=A0=A0=A0=A0 SOURCE vtk

=A0=A0=A0=A0=A0 COMMAND ${VTK_APPLE_RESOURCE}

=A0=A0=A0=A0=A0 ARGS Carbon.r -o ${EXECUTABLE_OUTPUT_PATH}/vtk

=A0=A0=A0=A0=A0 TARGET vtk

=A0=A0=A0=A0=A0 )

=A0 ENDIF(VTK_APPLE_RESOURCE)

ENDIF(VTK_USE_CARBON)


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D

Jon Harald Kaspersen=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0Tel: =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 73 59 75 89

Ph.D. Mechanical Engineering=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Mob:=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 93 03 65 90

Senior Scientist=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Pager=A0=A0=A0+47 96 84 29 94

SINTEF Unimed - Ultralyd=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0Fa=
x: =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0+47 73 59 78 73

N-7465 Trondheim

NORWAY=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0e-mail:=A0Jon.=
H.Kaspersen@unimed.sintef.no

=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0WEB:=A0=A0=A0=A0<underline><color><param>1A19,1A19,FF=
FE</param>http://www.us.unimed.sintef.no/

=
</color></underline>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


<</blockquote><</x-html>



</excerpt>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D

Jon Harald Kaspersen			Tel: 		+47 73 59 75 89

Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90

Senior Scientist				Pager	+47 96 84 29 94

SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73

N-7465 Trondheim

NORWAY			e-mail:	Jon.H.Kaspersen@unimed.sintef.no

				WEB:	=
<underline><color><param>1A19,1A19,FFFE</param>http://www.us.unimed.sintef=
.no/</color></underline>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D


</excerpt>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D

Jon Harald Kaspersen			Tel: 		+47 73 59 75 89

Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90

Senior Scientist				Pager	+47 96 84 29 94

SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73

N-7465 Trondheim

NORWAY			e-mail:	Jon.H.Kaspersen@unimed.sintef.no

				WEB:	=
<underline><color><param>1A1A,1A1A,FFFF</param>http://www.us.unimed.sintef=
.no/</color></underline>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D


--Apple-Mail-12-334933356--