Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LOG4CXX dependency problem #48

Open
wants to merge 1 commit into
base: rollback_usb
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this if clause be merged into the previous clause?

message(ERROR "log4cxx required")
endif()

generate_dynamic_reconfigure_options(cfg/OpenNI.cfg)

catkin_package(
Expand Down Expand Up @@ -44,6 +53,7 @@ target_link_libraries(openni_driver ${catkin_LIBRARIES}
${Boost_LIBRARIES}
${PC_LIBOPENNI_LIBRARIES}
${PC_LIBUSB_LIBRARIES}
${LOG4CXX_LIBRARIES}
)

# ROS nodelets library
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<build_depend>camera_info_manager</build_depend>
<build_depend>dynamic_reconfigure</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>log4cxx</build_depend>
<build_depend>nodelet</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
Expand All @@ -33,6 +34,7 @@
<run_depend>camera_info_manager</run_depend>
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>log4cxx</run_depend>
<run_depend>nodelet</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>sensor_msgs</run_depend>
Expand Down
2 changes: 2 additions & 0 deletions src/nodelets/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <sensor_msgs/distortion_models.h>
#include <boost/algorithm/string/replace.hpp>

#include <log4cxx/logger.h>

using namespace std;
using namespace openni_wrapper;
namespace openni_camera
Expand Down