title: Finding GLib with CMake: target_include_directories called with invalid arguments
body: <p>I have this following (minimal) <code>CMakeLists.txt</code> supposed to find GLib via <code>pkg-config</code> and add the libs to the <code>foo</code> target:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.10 FATAL_ERROR)
  project(foo)
  find_package(PkgConfig REQUIRED)
  pkg_check_modules(GLib REQUIRED glib-2.0)
  add_executable(foo foo.cpp)
  message(WARNING "libs:" ${GLIB_LIBRARIES})
  message(WARNING "includes:" ${GLIB_INCLUDE_DIRS})
  target_link_libraries(foo PUBLIC ${GLIB_LIBRARIES})
  target_include_directories(foo PUBLIC ${GLIB_INCLUDE_DIRS})
  </code></pre>
  
  <p>No matter what I try, I get (note the <code>Found glib-2.0</code> part):</p>
  
  <pre><code>-- The C compiler identification is GNU 7.3.0
  -- The CXX compiler identification is GNU 7.3.0
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
  -- Checking for module 'glib-2.0'
  --   Found glib-2.0, version 2.56.1
  CMake Warning at CMakeLists.txt:6 (message):
    libs:
  
  
  CMake Warning at CMakeLists.txt:7 (message):
    includes:
  
  
  CMake Error at CMakeLists.txt:9 (target_include_directories):
    target_include_directories called with invalid arguments
  
  
  -- Configuring incomplete, errors occurred!
  See also "/tmp/aaa/CMakeFiles/CMakeOutput.log".
  </code></pre>
  
  <p>and I cannot see, reading <a href="https://cmake.org/cmake/help/latest/command/target_include_directories.html#command:target_include_directories" rel="nofollow noreferrer">the CMake reference</a> what arguments are invalid (note: this question is different from <a href="https://stackoverflow.com/questions/49538580/cmake-target-include-directories-called-with-invalid-arguments">cmake target_include_directories called with invalid arguments</a>). I also looked at <a href="https://cmake.org/cmake/help/v3.0/module/FindPkgConfig.html" rel="nofollow noreferrer">CMake's FindPkgConfig documentation</a> which gives <code>glib</code> as an example and I am not able to reproduce it (<code>${GLIB_VERSION}</code>). I tried <code>GLIB_</code> and <code>GLIB2_</code> prefixes and all I get is empty strings.</p>
  
  <p>The messages show the variables are empty, though <code>pkg-config</code> reports values correctly:</p>
  
  <pre><code>$ pkg-config glib-2.0 --cflags --libs
  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0
  </code></pre>
  
  <p>The CMake version I have is 2.10.</p>
  
  <p>Can someone shed light on the issue?</p>