typegen generated cmake code without absolute paths?

Hey,

I was wondering whether the typegen generated cmake code could be
updated in order _not_ to contain any absolute paths. This would make
it possible to share generated typekits with others, without everyone
having to regenerate them. How hard would it be to implement this?

regards,

Steven

typegen generated cmake code without absolute paths?

On Wed, Sep 8, 2010 at 3:26 PM, Steven Bellens <
steven [dot] bellens [..] ...> wrote:

> Hey,
>
> I was wondering whether the typegen generated cmake code could be
> updated in order _not_ to contain any absolute paths. This would make
> it possible to share generated typekits with others, without everyone
> having to regenerate them. How hard would it be to implement this?
>

I haven't seen the code for these particular generated cmake scripts, but if
the absolute paths you're talking about can be obtained relative to the
location of the cmake script, you can obtain the script's location like so

get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

so you end up creating paths like "${SELF_DIR}/path/to/whatever". This is
currently used by the OrocosRTT cmake package configuration file, and allows
you to move the (whole) installation tree without breaking the package
finding process*.

HTH,

Adolfo

*As opposed to pkg-config, that AFAIK requires manual intervention if you
move the installation tree after invoking make install.

>
> regards,
>
> Steven
> --
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>

typegen generated cmake code without absolute paths?

2010/9/8 Adolfo Rodríguez Tsouroukdissian <adolfo [dot] rodriguez [..] ...>:
>
>
> On Wed, Sep 8, 2010 at 3:26 PM, Steven Bellens
> <steven [dot] bellens [..] ...> wrote:
>>
>> Hey,
>>
>> I was wondering whether the typegen generated cmake code could be
>> updated in order _not_ to contain any absolute paths. This would make
>> it possible to share generated typekits with others, without everyone
>> having to regenerate them. How hard would it be to implement this?
>
> I haven't seen the code for these particular generated cmake scripts, but if
> the absolute paths you're talking about can be obtained relative to the
> location of the cmake script, you can obtain the script's location like so
>
> get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
>
> so you end up creating paths like "${SELF_DIR}/path/to/whatever". This is
> currently used by the OrocosRTT cmake package configuration file, and allows
> you to move the (whole) installation tree without breaking the package
> finding process*.

That's indeed what I want!

The typekit.rb file (in the orogen repo) defines starting at line 383:
"
383 attr_reader :base_dir
384
385 # Changes the typekit base directory
386 def base_dir=(path)
387 @base_dir = path
388 if path
389 include_dirs << path
390 end
391 end "

I think I want this base_dir to be ${CMAKE_SOURCE_DIR}, but just
substituting this of course doesn't work :). Any ideas?

regards,

Steven

>
> HTH,
>
> Adolfo
>
> *As opposed to pkg-config, that AFAIK requires manual intervention if you
> move the installation tree after invoking make install.
>>
>> regards,
>>
>> Steven
>> --
>> Orocos-Dev mailing list
>> Orocos-Dev [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>
>
>
> --
> Adolfo Rodríguez Tsouroukdissian, Ph. D.
>
> Robotics engineer
> PAL ROBOTICS S.L
> http://www.pal-robotics.com
> Tel. +34.93.414.53.47
> Fax.+34.93.209.11.09
> AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
> contener información privilegiada y/o confidencial que está dirigida
> exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
> destinatario indicado, o el empleado encargado de su entrega a dicha
> persona, por favor, notifíquelo inmediatamente y remita el mensaje original
> a la dirección de correo electrónico indicada. Cualquier copia, uso o
> distribución no autorizados de esta comunicación queda estrictamente
> prohibida.
>
> CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
> contain confidential information which is privileged and intended only for
> the individual or entity to whom they are addressed.  If you are not the
> intended recipient, you are hereby notified that any disclosure, copying,
> distribution or use of this e-mail and/or accompanying document(s) is
> strictly prohibited.  If you have received this e-mail in error, please
> immediately notify the sender at the above e-mail address.
>

typegen generated cmake code without absolute paths?

2010/9/8 Steven Bellens <steven [dot] bellens [..] ...>

> 2010/9/8 Adolfo Rodríguez Tsouroukdissian <
> adolfo [dot] rodriguez [..] ...>:
> >
> >
> > On Wed, Sep 8, 2010 at 3:26 PM, Steven Bellens
> > <steven [dot] bellens [..] ...> wrote:
> >>
> >> Hey,
> >>
> >> I was wondering whether the typegen generated cmake code could be
> >> updated in order _not_ to contain any absolute paths. This would make
> >> it possible to share generated typekits with others, without everyone
> >> having to regenerate them. How hard would it be to implement this?
> >
> > I haven't seen the code for these particular generated cmake scripts, but
> if
> > the absolute paths you're talking about can be obtained relative to the
> > location of the cmake script, you can obtain the script's location like
> so
> >
> > get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
> >
> > so you end up creating paths like "${SELF_DIR}/path/to/whatever". This is
> > currently used by the OrocosRTT cmake package configuration file, and
> allows
> > you to move the (whole) installation tree without breaking the package
> > finding process*.
>
> That's indeed what I want!
>
> The typekit.rb file (in the orogen repo) defines starting at line 383:
> "
> 383 attr_reader :base_dir
> 384
> 385 # Changes the typekit base directory
> 386 def base_dir=(path)
> 387 @base_dir = path
> 388 if path
> 389 include_dirs << path
> 390 end
> 391 end "
>
> I think I want this base_dir to be ${CMAKE_SOURCE_DIR}, but just
> substituting this of course doesn't work :). Any ideas?
>

If you're generating a cmake script, the generated file should contain this
line:

get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

and then when you want to refer to a fully qualified path, construct the
path using the SELF_DIR variable, like so: "${SELF_DIR}/path/to/whatever"
You can post your generated cmake script if this still does not work.

Adolfo

>
> regards,
>
> Steven
>
> >
> > HTH,
> >
> > Adolfo
> >
> > *As opposed to pkg-config, that AFAIK requires manual intervention if you
> > move the installation tree after invoking make install.
> >>
> >> regards,
> >>
> >> Steven
> >> --
> >> Orocos-Dev mailing list
> >> Orocos-Dev [..] ...
> >> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
> >
> >
> >
> > --
> > Adolfo Rodríguez Tsouroukdissian, Ph. D.
> >
> > Robotics engineer
> > PAL ROBOTICS S.L
> > http://www.pal-robotics.com
> > Tel. +34.93.414.53.47
> > Fax.+34.93.209.11.09
> > AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
> > contener información privilegiada y/o confidencial que está dirigida
> > exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
> > destinatario indicado, o el empleado encargado de su entrega a dicha
> > persona, por favor, notifíquelo inmediatamente y remita el mensaje
> original
> > a la dirección de correo electrónico indicada. Cualquier copia, uso o
> > distribución no autorizados de esta comunicación queda estrictamente
> > prohibida.
> >
> > CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
> > contain confidential information which is privileged and intended only
> for
> > the individual or entity to whom they are addressed. If you are not the
> > intended recipient, you are hereby notified that any disclosure, copying,
> > distribution or use of this e-mail and/or accompanying document(s) is
> > strictly prohibited. If you have received this e-mail in error, please
> > immediately notify the sender at the above e-mail address.
> >
>

typegen generated cmake code without absolute paths?

On Wednesday 08 September 2010 15:26:56 Steven Bellens wrote:
> Hey,
>
> I was wondering whether the typegen generated cmake code could be
> updated in order _not_ to contain any absolute paths. This would make
> it possible to share generated typekits with others, without everyone
> having to regenerate them. How hard would it be to implement this?

Ah, you're looking to check-in the generated cmake code ? This must certainly
be possible since the typekit only relies om RTT being installed in a
CMAKE_PREFIX_PATH directory.

I think it only requires editing the template files. Since these contain ruby
commands, there must be some kind of command to make a path relative,
or strip a certain component.

Peter