forked from orocos-toolchain/rtt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logger: Support logging using log4cpp framework
Supports logging using the log4cpp framework, which replaces logging both to file and via printf. The log4cpp option defaults off. This fix also ensures that application code is informed of the build option.
- Loading branch information
Showing
5 changed files
with
101 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
################################################################################ | ||
# | ||
# CMake script for finding Log4cpp. | ||
# The default CMake search process is used to locate files. | ||
# | ||
# This script creates the following variables: | ||
# LOG4CPP_FOUND: Boolean that indicates if the package was found | ||
# LOG4CPP_INCLUDE_DIRS: Paths to the necessary header files | ||
# LOG4CPP_LIBRARIES: Package libraries | ||
# LOG4CPP_LIBRARY_DIRS: Path to package libraries | ||
# | ||
################################################################################ | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
# Find headers and libraries | ||
find_path(LOG4CPP_INCLUDE_DIR NAMES log4cpp/Category.hh) | ||
find_library(LOG4CPP_LIBRARY NAMES log4cpp) | ||
|
||
# Set LOG4CPP_FOUND honoring the QUIET and REQUIRED arguments | ||
find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_LIBRARY LOG4CPP_INCLUDE_DIR) | ||
|
||
# Output variables | ||
if(LOG4CPP_FOUND) | ||
# Include dirs | ||
set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR}) | ||
|
||
# Libraries | ||
set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY}) | ||
|
||
# Link dirs | ||
get_filename_component(LOG4CPP_LIBRARY_DIRS ${LOG4CPP_LIBRARY} PATH) | ||
endif() | ||
|
||
# Advanced options for not cluttering the cmake UIs | ||
mark_as_advanced(LOG4CPP_INCLUDE_DIR LOG4CPP_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters