Martin  Felis avatar Martin Felis committed 8fa666e

added missing FindURDF.cmake

Comments (0)

Files changed (1)

addons/urdfreader/CMake/FindURDF.cmake

+# Try to find shared object of the urdf library
+
+SET (URDF_FOUND FALSE)
+
+FIND_PROGRAM(ROSPACK rospack)
+IF(NOT ROSPACK)
+	MESSAGE(FATAL_ERROR "failed to find the rospack binary. Is ROS installed?")
+ENDIF()
+
+EXEC_PROGRAM("${ROSPACK} find ${PKG}" OUTPUT_VARIABLE ${PKG}_ROS_PREFIX)
+IF(NOT ${PKG}_ROS_PREFIX)
+  MESSAGE(FATAL_ERROR "Failed to detect ${PKG}.")
+ENDIF()
+
+EXEC_PROGRAM("${ROSPACK} find urdf" OUTPUT_VARIABLE URDF_FULL_PATH)
+
+FIND_PATH (URDF_INCLUDE_DIR urdf/model.h ${URDF_FULL_PATH}/include)
+FIND_LIBRARY (URDF_LIBRARY urdf ${URDF_FULL_PATH}/lib)
+
+IF (URDF_INCLUDE_DIR AND URDF_LIBRARY)
+	SET (URDF_FOUND TRUE)
+ENDIF (URDF_INCLUDE_DIR AND URDF_LIBRARY)
+
+IF (URDF_FOUND)
+   IF (NOT URDF_FIND_QUIETLY)
+      MESSAGE(STATUS "Found URDF: ${URDF_LIBRARY}")
+   ENDIF (NOT URDF_FIND_QUIETLY)
+ELSE (URDF_FOUND)
+   IF (URDF_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find URDF")
+   ENDIF (URDF_FIND_REQUIRED)
+ENDIF (URDF_FOUND)
+
+MARK_AS_ADVANCED (
+	URDF_INCLUDE_DIR
+	URDF_LIBRARY
+	)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.