make finding genmsg for roslang optional

This commit is contained in:
Dirk Thomas 2012-10-06 08:14:36 +00:00
parent ffb4fe6e92
commit 707e20c29c
1 changed files with 13 additions and 11 deletions

View File

@ -21,17 +21,19 @@ foreach(_l ${_roslang_LANGS})
endforeach(_l)
# Hack to resolve languages from wet which rospack does not support yet
find_package(catkin REQUIRED COMPONENTS genmsg)
foreach(_l ${CATKIN_MESSAGE_GENERATORS})
string(REPLACE "gen" "ros" _l ${_l})
rosbuild_find_ros_package(${_l})
if(${_l}_PACKAGE_PATH)
set(_cmake_fragment ${${_l}_PACKAGE_PATH}/rosbuild/${_l}.cmake)
if(EXISTS ${_cmake_fragment})
list(APPEND _cmake_fragments ${_cmake_fragment})
endif()
endif(${_l}_PACKAGE_PATH)
endforeach(_l)
find_package(catkin COMPONENTS genmsg)
if(genmsg_FOUND)
foreach(_l ${CATKIN_MESSAGE_GENERATORS})
string(REPLACE "gen" "ros" _l ${_l})
rosbuild_find_ros_package(${_l})
if(${_l}_PACKAGE_PATH)
set(_cmake_fragment ${${_l}_PACKAGE_PATH}/rosbuild/${_l}.cmake)
if(EXISTS ${_cmake_fragment})
list(APPEND _cmake_fragments ${_cmake_fragment})
endif()
endif(${_l}_PACKAGE_PATH)
endforeach(_l)
endif()
# Now include them all
foreach(_f ${_cmake_fragments})