Re: [ros-users] rosmake CMakeLists.txt rosversion test

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Brian Gerkey
Dato:  
Til: ros-users
Emne: Re: [ros-users] rosmake CMakeLists.txt rosversion test
hi Ben,

What you're doing is reasonable, given that there's not currently
support for doing it any better. However, you really want to be
testing the version of actionlib, not ros; the two evolve
independently.

There's currently no way to do that, so I've ticketed myself to add a
package/stack version query in rosbuild:
https://code.ros.org/trac/ros/ticket/3010 .

    brian.


On Wed, Sep 15, 2010 at 7:11 AM, Axelrod, Benjamin <> wrote:
> Is there an easy way to test for the ROS version in a CMakeLists.txt file?
> For example, when using actionlib, two different sets of commands must be
> used to generate the action messages.  I came up with this CMake way to do
> it, but it is rather clumsy and I am not exactly sure of the version
> numbers.  It would be nice if rosbuild provided simple macros for this.
>
>
>
> execute_process(COMMAND rosversion ros
>
>                 RESULT_VARIABLE rosversion)
>
> IF (${rosversion} GREATER 1.05)
>
>   message("CTurtle")
>
> ELSE (${rosversion} GREATER 1.05)
>
>   message("BoxTurtle")
>
> ENDIF (${rosversion} GREATER 1.05)
>
>
>
> Thanks,
>
> -Ben
>
>
>
> Ben Axelrod
>
> Research Scientist
>
> iRobot Corporation
>
> 8 Crosby Drive, Mail Stop 8-1
>
> Bedford, MA 01730
>
> (781) 430-3315 (Tel)
>
> (781) 960-2628 (Fax)
>
>
>
>
>
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>
>