forked from orocos-toolchain/rtt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFindLog4cpp.cmake
36 lines (29 loc) · 1.19 KB
/
FindLog4cpp.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)