diff --git a/CMakeLists.txt b/CMakeLists.txt index 509e136..8db2287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,11 +30,7 @@ ELSE (WIN32) ENDIF (APPLE) ENDIF (WIN32) -#IF ( CMAKE_BUILD_TYPE MATCHES "Debug" ) -# SET ( LOG4CPP_LIBRARY_NAME "log4cppD" ) -#ELSE ( CMAKE_BUILD_TYPE MATCHES "Debug" ) - SET ( LOG4CPP_LIBRARY_NAME "log4cpp" ) -#ENDIF ( CMAKE_BUILD_TYPE MATCHES "Debug" ) +SET ( LOG4CPP_LIBRARY_NAME "orocos-log4cpp" ) ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME} SHARED src/Appender.cpp @@ -92,12 +88,28 @@ IF (WIN32) # SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES LINK_FLAGS /NODEFAULTLIB:msvcrt) ENDIF (WIN32) -# Note: this so-version is required by OCL, such that it can distinguish 'regular' log4cpp -# from 'rtt' log4cpp. -SET(VERSION "6.0.0") -SET(SOVERSION "6.0") +SET(VERSION "2.9.1") +SET(SOVERSION "2.9") SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES VERSION ${VERSION} SOVERSION ${SOVERSION}) +# Ensure that the full path+lib name is used in dynamic library dependencies +# in dependent libraries/executables. Without this, CMake drops the path and +# the dependency becomes just the lib name (which requires working DYLD_xxx) +SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES + INSTALL_RPATH_USE_LINK_PATH ON) +# Set INSTALL_NAME_DIR for MacOS X to tell users of this library how to find it: +if(APPLE) + if (CMAKE_VERSION VERSION_LESS "3.0.0") + SET_TARGET_PROPERTIES( ${LOG4CPP_LIBRARY_NAME} PROPERTIES + INSTALL_NAME_DIR "@rpath" + ) + else() + # cope with CMake 3.x + SET_TARGET_PROPERTIES( ${LOG4CPP_LIBRARY_NAME} PROPERTIES + MACOSX_RPATH ON) + endif() +endif() + ADD_DEFINITIONS(${LOG4CPP_CFLAGS}) ########################################################### @@ -120,18 +132,18 @@ SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(exec_prefix "\${prefix}") SET(log4cpp_cflags "") SET(log4cpp_libs "${LOG4CPP_LIBS}") -SET(includedir "\${prefix}/include") +SET(includedir "\${prefix}/include/orocos") SET(libdir "\${prefix}/lib") -CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/log4cpp.pc @ONLY) +CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc @ONLY) INSTALL( - FILES ${CMAKE_CURRENT_BINARY_DIR}/log4cpp.pc + FILES ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc DESTINATION lib/pkgconfig ) INSTALL ( DIRECTORY include/log4cpp - DESTINATION include + DESTINATION include/orocos PATTERN "config.h.in" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "*.am" EXCLUDE @@ -141,7 +153,7 @@ INSTALL ( INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/include/log4cpp/config.h - DESTINATION include/log4cpp + DESTINATION include/orocos/log4cpp ) INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} diff --git a/log4cpp.pc.in b/log4cpp.pc.in index 4d58136..44c5797 100755 --- a/log4cpp.pc.in +++ b/log4cpp.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: @PACKAGE@ Description: C++ library for flexible logging, modeled after Log4j Version: @VERSION@ -Libs: -L${libdir} -llog4cpp +Libs: -L${libdir} -l@LOG4CPP_LIBRARY_NAME@ Cflags: -I${includedir} @log4cpp_cflags@ Libs.private: @log4cpp_libs@ diff --git a/package.xml b/package.xml index 162f72a..408e46b 100644 --- a/package.xml +++ b/package.xml @@ -1,6 +1,6 @@ log4cpp - 2.8.3 + 2.9.1 Log4cpp maintained by Orocos developers This version of log4cpp deviates from the official release