diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5570974..0684df2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,15 @@ find_package(PkgConfig)
pkg_check_modules(PC_LIBOPENNI REQUIRED libopenni)
pkg_check_modules(PC_LIBUSB REQUIRED libusb-1.0)
+find_package(Log4cxx QUIET)
+if(NOT LOG4CXX_LIBRARIES)
+ # backup plan, hope it is in the system path
+ find_library(LOG4CXX_LIBRARIES log4cxx)
+endif()
+if(NOT LOG4CXX_LIBRARIES)
+ message(ERROR "log4cxx required")
+endif()
+
generate_dynamic_reconfigure_options(cfg/OpenNI.cfg)
catkin_package(
@@ -44,6 +53,7 @@ target_link_libraries(openni_driver ${catkin_LIBRARIES}
${Boost_LIBRARIES}
${PC_LIBOPENNI_LIBRARIES}
${PC_LIBUSB_LIBRARIES}
+ ${LOG4CXX_LIBRARIES}
)
# ROS nodelets library
diff --git a/package.xml b/package.xml
index f051b02..82add23 100644
--- a/package.xml
+++ b/package.xml
@@ -22,6 +22,7 @@
camera_info_manager
dynamic_reconfigure
image_transport
+ log4cxx
nodelet
roscpp
sensor_msgs
@@ -33,6 +34,7 @@
camera_info_manager
dynamic_reconfigure
image_transport
+ log4cxx
nodelet
roscpp
sensor_msgs
diff --git a/src/nodelets/driver.cpp b/src/nodelets/driver.cpp
index a0ef0ee..6b99a22 100644
--- a/src/nodelets/driver.cpp
+++ b/src/nodelets/driver.cpp
@@ -46,6 +46,8 @@
#include
#include
+#include
+
using namespace std;
using namespace openni_wrapper;
namespace openni_camera