title: CMake third-party library installation
body: <p>I'm new in programming. And for my study project I need to install a third-party library for using with CMake (<a href="https://github.com/cpp-io2d/P0267_RefImpl/blob/master/BUILDING.md" rel="nofollow noreferrer">GitHub project</a>).</p>
  
  <p>I use Arch OS on my PC. Usually I build all non-repository packages in: <em>~/aur</em>. CMake version is 3.17.</p>
  
  <p>Then I try to build a library according to the instructions:</p>
  
  <pre><code>...
  cmake --config Debug "-DCMAKE_BUILD_TYPE=Debug" ..
  </code></pre>
  
  <p>it makes me an error:</p>
  
  <pre><code>CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  PNG_INCLUDE_DIR
     used as include directory in directory /home/wizki/aur/P0267_RefImpl/P0267_RefImpl/Tests
  
  -- Generating done
  CMake Generate step failed.  Build files cannot be regenerated correctly.
  </code></pre>
  
  <p>If I ignore this error and build this library using:</p>
  
  <pre><code>cmake --build .
  </code></pre>
  
  <p>The building is succesful, but durin my project building I have an error:</p>
  
  <pre><code>CMake Error at CMakeLists.txt:15 (find_package):
    By not providing "Findio2d.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "io2d", but
    CMake did not find one.
  
  Could not find a package configuration file provided by "io2d" with any of
    the following names:
  
      io2dConfig.cmake
      io2d-config.cmake
  
  Add the installation prefix of "io2d" to CMAKE_PREFIX_PATH or set
  "io2d_DIR" to a directory containing one of the above files.  If "io2d"
  provides a separate development package or SDK, be sure it has been
  installed.
  
  -- Configuring incomplete, errors occurred!
  </code></pre>
  
  <p>After a web search I've tried this solution: <a href="https://www.daniweb.com/programming/software-development/threads/438160/png-include-directory-cmake" rel="nofollow noreferrer">Daniweb</a>. 
  libpng and zlib packages are installed; FindPNG.cmake exists in <em>/usr/share/cmake-3.17/Modules/</em>.
  But my <em>$CMAKE_INCLUDE_PATH</em> and <em>$CMAKE_LIBRARY_PATH</em> are empty:</p>
  
  <pre><code>[wizki@evix Debug]$ echo $CMAKE_INCLUDE_PATH
  
  [wizki@evix Debug]$ echo $CMAKE_LIBRARY_PATH
  </code></pre>
  
  <p>I've tried to search in FindPNG.cmake for paths, but no result. From <a href="https://cmake.org/cmake/help/v3.11/command/find_package.html" rel="nofollow noreferrer">CMake wiki</a> I suppose that one of the library path is <em>/usr/lib</em>. I've tried to build a library inside, but I have a same issue.</p>
  
  <p>What can I try next?</p>