FYI: last Monday, I upgraded (on trunk) the rosversion tool to take in any stack name as an argument. It currently scrapes from the CMakeLists.txt file, but as ticket #3010 progresses, I'll update it in kind. We hope to have better version mechanisms for Diamondback. - Ken On Wed, Sep 15, 2010 at 1:15 PM, Brian Gerkey wrote: > 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) >> >> baxelrod@irobot.com >> >> >> >> _______________________________________________ >> ros-users mailing list >> ros-users@code.ros.org >> https://code.ros.org/mailman/listinfo/ros-users >> >> > _______________________________________________ > ros-users mailing list > ros-users@code.ros.org > https://code.ros.org/mailman/listinfo/ros-users >