[ros-users] rosmake CMakeLists.txt rosversion test

Axelrod, Benjamin baxelrod at irobot.com
Wed Sep 15 14:11:17 UTC 2010


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 at irobot.com <mailto:ofitch at irobot.com> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100915/3bea772b/attachment-0002.html>


More information about the ros-users mailing list