check for CATKIN_ENABLE_TESTING

This commit is contained in:
Lukas Bulwahn 2013-09-15 14:35:12 +02:00
parent f61b2c699a
commit eec215e06c
8 changed files with 20 additions and 12 deletions

View File

@ -65,9 +65,11 @@ target_link_libraries(collada_to_urdf ${ASSIMP_LIBRARIES} ${catkin_LIBRARIES} ${
set_target_properties(collada_to_urdf PROPERTIES COMPILER_FLAGS "${ASSIMP_CXX_FLAGS} ${ASSIMP_CFLAGS_OTHER}") set_target_properties(collada_to_urdf PROPERTIES COMPILER_FLAGS "${ASSIMP_CXX_FLAGS} ${ASSIMP_CFLAGS_OTHER}")
set_target_properties(collada_to_urdf PROPERTIES LINK_FLAGS "${ASSIMP_LINK_FLAGS}") set_target_properties(collada_to_urdf PROPERTIES LINK_FLAGS "${ASSIMP_LINK_FLAGS}")
catkin_add_gtest(test_collada_writer test/test_collada_urdf.cpp) if(CATKIN_ENABLE_TESTING)
target_link_libraries(test_collada_writer ${PROJECT_NAME} ${catkin_LIBRARIES} ${COLLADA_DOM_LIBRARIES} catkin_add_gtest(test_collada_writer test/test_collada_urdf.cpp)
target_link_libraries(test_collada_writer ${PROJECT_NAME} ${catkin_LIBRARIES} ${COLLADA_DOM_LIBRARIES}
${Boost_LIBRARIES}) ${Boost_LIBRARIES})
endif()
install(TARGETS ${PROJECT_NAME} urdf_to_collada collada_to_urdf install(TARGETS ${PROJECT_NAME} urdf_to_collada collada_to_urdf
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}

View File

@ -16,7 +16,7 @@
<url type="website">http://ros.org/wiki/collada_urdf</url> <url type="website">http://ros.org/wiki/collada_urdf</url>
<buildtool_depend>catkin</buildtool_depend> <buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
<build_depend>angles</build_depend> <build_depend>angles</build_depend>
<build_depend>assimp</build_depend> <build_depend>assimp</build_depend>

View File

@ -31,8 +31,10 @@ target_link_libraries(${PROJECT_NAME}
add_executable(check_kdl_parser src/check_kdl_parser.cpp ) add_executable(check_kdl_parser src/check_kdl_parser.cpp )
target_link_libraries(check_kdl_parser ${PROJECT_NAME}) target_link_libraries(check_kdl_parser ${PROJECT_NAME})
catkin_add_gtest(test_kdl_parser test/test_kdl_parser.cpp ) if(CATKIN_ENABLE_TESTING)
target_link_libraries(test_kdl_parser ${PROJECT_NAME}) catkin_add_gtest(test_kdl_parser test/test_kdl_parser.cpp )
target_link_libraries(test_kdl_parser ${PROJECT_NAME})
endif()
# How does CATKIN do this? # How does CATKIN do this?
#rosbuild_add_rostest(${PROJECT_SOURCE_DIR}/test/test_kdl_parser.launch) #rosbuild_add_rostest(${PROJECT_SOURCE_DIR}/test/test_kdl_parser.launch)

View File

@ -17,7 +17,7 @@
<url type="repository">https://github.com/ros/robot_model</url> <url type="repository">https://github.com/ros/robot_model</url>
<url type="bugtracker">https://github.com/ros/robot_model/issues</url> <url type="bugtracker">https://github.com/ros/robot_model/issues</url>
<buildtool_depend>catkin</buildtool_depend> <buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
<build_depend>orocos_kdl</build_depend> <build_depend>orocos_kdl</build_depend>
<build_depend>rosconsole</build_depend> <build_depend>rosconsole</build_depend>

View File

@ -26,7 +26,9 @@ include_directories(${CURL_INCLUDE_DIRS})
add_library(${PROJECT_NAME} src/retriever.cpp) add_library(${PROJECT_NAME} src/retriever.cpp)
target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES} ${catkin_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES} ${catkin_LIBRARIES})
add_subdirectory(test EXCLUDE_FROM_ALL) if(CATKIN_ENABLE_TESTING)
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME}
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

View File

@ -19,7 +19,7 @@
<url type="repository">https://github.com/ros/robot_model</url> <url type="repository">https://github.com/ros/robot_model</url>
<url type="bugtracker">https://github.com/ros/robot_model/issues</url> <url type="bugtracker">https://github.com/ros/robot_model/issues</url>
<buildtool_depend>catkin</buildtool_depend> <buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
<build_depend>curl</build_depend> <build_depend>curl</build_depend>
<build_depend>rosconsole</build_depend> <build_depend>rosconsole</build_depend>

View File

@ -33,8 +33,10 @@ if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(APPLE) endif(APPLE)
catkin_add_gtest(test_parser EXCLUDE_FROM_ALL test/test_robot_model_parser.cpp) if(CATKIN_ENABLE_TESTING)
target_link_libraries(test_parser ${PROJECT_NAME}) catkin_add_gtest(test_parser EXCLUDE_FROM_ALL test/test_robot_model_parser.cpp)
target_link_libraries(test_parser ${PROJECT_NAME})
endif()
# no idea how CATKIN does this # no idea how CATKIN does this
# rosbuild_add_rostest(${PROJECT_SOURCE_DIR}/test/test_robot_model_parser.launch) # rosbuild_add_rostest(${PROJECT_SOURCE_DIR}/test/test_robot_model_parser.launch)

View File

@ -17,7 +17,7 @@
<url type="repository">https://github.com/ros/robot_model</url> <url type="repository">https://github.com/ros/robot_model</url>
<url type="bugtracker">https://github.com/ros/robot_model/issues</url> <url type="bugtracker">https://github.com/ros/robot_model/issues</url>
<buildtool_depend>catkin</buildtool_depend> <buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
<build_depend>rosconsole_bridge</build_depend> <build_depend>rosconsole_bridge</build_depend>
<build_depend>roscpp</build_depend> <build_depend>roscpp</build_depend>