~elementary-apps/pantheon-chat/trunk

« back to all changes in this revision

Viewing changes to cmake/GetPkgConfigVar.cmake

  • Committer: Corentin Noël
  • Date: 2014-06-21 21:06:00 UTC
  • Revision ID: corentin@elementaryos.org-20140621210600-s26ajp7z6wugty8k
First Commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - try to get pkgconfig variables
 
2
#
 
3
# Copyright (C) 2010, Pino Toscano, <pino@kde.org>
 
4
# Copyright (C) 2014, Corentin Noël, <tintou@mailoo.org>
 
5
#
 
6
# Redistribution and use is allowed according to the terms of the BSD license.
 
7
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
8
 
 
9
macro(GET_PKGCONFIG_VAR _outvar _varname _filename)
 
10
  execute_process(
 
11
    COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} ${_filename}
 
12
    OUTPUT_VARIABLE _result
 
13
    RESULT_VARIABLE _null
 
14
  )
 
15
 
 
16
  if (_null)
 
17
  else()
 
18
    string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
 
19
    string(REGEX REPLACE " +$" ""  _result "${_result}")
 
20
    separate_arguments(_result)
 
21
    set(${_outvar} ${_result} CACHE INTERNAL "")
 
22
  endif()
 
23
endmacro(GET_PKGCONFIG_VAR)
 
 
b'\\ No newline at end of file'