Skip to content

Commit

Permalink
Moved OPENRAVE_LOG4CXX into config.h. Fix a bunch of flags issues. Ad…
Browse files Browse the repository at this point in the history
…d logging.h.
  • Loading branch information
ziyan committed Jan 30, 2016
1 parent 75602f6 commit 79a2101
Show file tree
Hide file tree
Showing 13 changed files with 560 additions and 538 deletions.
23 changes: 17 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ option(OPT_BUILD_PACKAGE_DEFAULT "Set to ON to generate a default openrave packa
option(OPT_IKFAST_FLOAT32 "Set to ON to allow loading of ikfast shared objects compiled with 32bit float (64bit double is always supported regardless of this option)" ON)
option(OPT_FLANN "Temporary switch to force building of flann" OFF)
option(OPT_CBINDINGS "Build the C-bindings libraries libopenrave_c and libopenrave-core_c" ON)
option(OPT_LOG4CXX "Use log4cxx for logging" OFF)
option(OPT_LOG4CXX "Use log4cxx for logging" ON)

set(PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/modules-cmake")
Expand Down Expand Up @@ -720,19 +720,30 @@ if( NOT FPARSER_FOUND )
endif()

# log4cxx logging lib
set(OPENRAVE_LOG4CXX 0)
set(OPENRAVE_LOG4CXX_INCLUDE_DIRS)
set(OPENRAVE_LOG4CXX_LIB_DIRS)
set(OPENRAVE_LOG4CXX_LIBRARY)
if( OPT_LOG4CXX )
pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
pkg_check_modules(LOG4CXX liblog4cxx)
if( LOG4CXX_FOUND )
set(OPENRAVE_EXPORT_CXXFLAGS "${OPENRAVE_EXPORT_CXXFLAGS} -DOPENRAVE_LOG4CXX")
set(OPENRAVE_LOG4CXX_INCLUDE_DIRS "-I${LOG4CXX_INCLUDEDIR}")
set(OPENRAVE_LOG4CXX_LIB_DIRS "-L${LOG4CXX_LIBDIR}")
set(OPENRAVE_LOG4CXX_LIBRARY "-llog4cxx")
if( MSVC )
set(OPENRAVE_LOG4CXX_INCLUDE_DIRS "/I\"${LOG4CXX_INCLUDEDIR}\"")
set(OPENRAVE_LOG4CXX_LIB_DIRS "/LIBPATH:\"${LOG4CXX_LIBDIR}\"")
else()
set(OPENRAVE_LOG4CXX_INCLUDE_DIRS "-I${LOG4CXX_INCLUDEDIR}")
set(OPENRAVE_LOG4CXX_LIB_DIRS "-L${LOG4CXX_LIBDIR}")
endif()
set(OPENRAVE_LOG4CXX_LIBRARY "-l${LOG4CXX_LIBRARIES}")

include_directories(${LOG4CXX_INCLUDEDIR})
set(OPENRAVE_LINK_DIRS ${OPENRAVE_LINK_DIRS} ${LOG4CXX_LIBDIR})
set(OPENRAVE_LOG4CXX 1)
endif()
endif()

link_directories(${OPENRAVE_LINK_DIRS})

message(STATUS "compiling local convexdecomposition library")
add_subdirectory(3rdparty/convexdecomposition)
set(CONVEXDECOMPOSITION_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/convexdecomposition")
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@
// the python path that OpenRAVE was compiled with
#define OPENRAVE_PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@"

// whether log4cxx is to be used
#define OPENRAVE_LOG4CXX @OPENRAVE_LOG4CXX@

#endif
Loading

0 comments on commit 79a2101

Please sign in to comment.