summaryrefslogtreecommitdiff
path: root/libproxy/cmake/pkgconfig.cmk
blob: ffa0897161e8278aaad7e8d6b38f4959dae21a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if(NOT WIN32)
  find_package(PkgConfig)

  # Define our magical px_check_modules function
  function(px_check_modules name)
    if(PKG_CONFIG_EXECUTABLE)
      option(WITH_${name} "Search for ${name} package" ON)
      if (WITH_${name})
        pkg_check_modules(${name} ${ARGN})
        if(${${name}_FOUND})
          include_directories(${${name}_INCLUDE_DIRS})
          link_directories(${${name}_LIBRARY_DIRS})
        else()
          set(${name}_FOUND 0 PARENT_SCOPE)
        endif()
      else()
        set(${name}_FOUND 0 PARENT_SCOPE)
      endif()
    endif()
  endfunction(px_check_modules)
endif()