File: Log4CPlusUtils.cmake

package info (click to toggle)
log4cplus 2.0.8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,592 kB
  • sloc: cpp: 53,091; sh: 10,537; ansic: 1,845; python: 1,226; perl: 263; makefile: 209; xml: 85; objc: 59
file content (17 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# Utility macros for Log4Cplus project
#

# Get Log4cplus version macro
# first param - path to include folder, we will rip version from version.h
macro(log4cplus_get_version _include_PATH vmajor vminor vpatch)
  file(STRINGS "${_include_PATH}/log4cplus/version.h" _log4cplus_VER_STRING_AUX REGEX ".*#define[ ]+LOG4CPLUS_VERSION[ ]+")
  string(REGEX MATCHALL "[0-9]+" _log4clpus_VER_LIST "${_log4cplus_VER_STRING_AUX}")
  list(LENGTH _log4clpus_VER_LIST _log4cplus_VER_LIST_LEN)
# we also count '4' from the name...
  if(_log4cplus_VER_LIST_LEN EQUAL 5)
    list(GET _log4clpus_VER_LIST 2 ${vmajor})
    list(GET _log4clpus_VER_LIST 3 ${vminor})
    list(GET _log4clpus_VER_LIST 4 ${vpatch})
  endif()
endmacro()