Hi guys,
I have created a component using the orocreate-pkg script.
I want to link my component to the scripting plugin: I explicitly use
Scripting in my code to load and manipulate programs and state machines.
As the orocos_component macros does not seem to allow defining a custom
link, I defined rtt-scripting in the find orocos line:
find_package(OROCOS-RTT REQUIRED ${RTT_HINTS} rtt-scripting)
At configuration, the scripting library is found.
The problem is that the scripting library is defined in
OROCOS-RTT_RTT-SCRIPTING_LIBRARY, and that the orocos_component macro
uses OROCOS-RTT_LIBRARIES, that only contains the core rtt libs.
Is this a normal behavior? How to link my component to the scripting
plugin using the Orocos macros?
Thanks,
Charles.
Link to scripting using the UseOrocos macros
Hi Charles,
On Wed, Feb 9, 2011 at 2:42 PM, Charles Lesire-Cabaniols
<Charles [dot] Lesire [..] ...> wrote:
> Hi guys,
>
> I have created a component using the orocreate-pkg script.
> I want to link my component to the scripting plugin: I explicitly use
> Scripting in my code to load and manipulate programs and state machines.
>
> As the orocos_component macros does not seem to allow defining a custom
> link, I defined rtt-scripting in the find orocos line:
> find_package(OROCOS-RTT REQUIRED ${RTT_HINTS} rtt-scripting)
You should change that to:
find_package(OROCOS-RTT REQUIRED rtt-scripting ${RTT_HINTS})
>
> At configuration, the scripting library is found.
> The problem is that the scripting library is defined in
> OROCOS-RTT_RTT-SCRIPTING_LIBRARY, and that the orocos_component macro
> uses OROCOS-RTT_LIBRARIES, that only contains the core rtt libs.
>
> Is this a normal behavior? How to link my component to the scripting
> plugin using the Orocos macros?
This is what you need to do:
orocos_component( foocomponent FooSource.cpp)
target_link_libraries( foocomponent ${OROCOS-RTT_RTT-SCRIPTING_LIBRARY})
Ie, you are free to use target_link_libraries on the target you gave
to orocos_component. This is so for every orocos_ macro. I think the
cheat-sheet briefly mentions this.
http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/rtt_cheat_sh...
(from http://www.orocos.org/wiki/orocos/toolchain/toolchain-reference-manuals
)
Peter