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)