Using GPGME in Debian for C++ Application
<p>I would like to use GPGME for key generation and encryption in my C++ application. However, while trying to get started, I got stuck with a problems:</p>

<p>I dowloaded the dev package for my debian system. Now I would like to tell my compiler (gcc in Qt Creator) where to find the library with cmake using the <a href="https://www.gnupg.org/documentation/manuals/gpgme/Building-the-Source.html#Building-the-Source" rel="nofollow">tool mentioned in the documentation</a>. But I don't know how to add <code>gpgme-config --cflags --libs</code> to my compiler flags. This didn't work:</p>

<pre><code>SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} `gpgme-config --cflags --libs` ")
</code></pre>

<p>When I try to build the app the compiler can't find <code>gpgme-config</code>:</p>

<pre><code>c++: error: $(gpgme-config: File or Directory not found
c++: error: unrecognized command line option ‘--cflags’
c++: error: unrecognized command line option ‘--libs)’
</code></pre>

<p>Anyway executing <code>gpgme-config --cflags --libs</code> on command line DOES give me a result:</p>

<pre><code>-L/usr/lib/x86_64-linux-gnu -lgpgme -lassuan -lgpg-error
</code></pre>

<p>I know the documentation also mentions Automake and libtool to make this process easier. But I neither used Automake or libtool before.</p>

<hr>

<p><strong>UPDATE:</strong></p>

<p>I also tried to use a FindGpgme.cmake file for GPGME. But the <a href="https://github.com/licq-im/licq/blob/master/licq/cmake/Modules/FindGpgme.cmake" rel="nofollow">first file</a> I used required several other cmake files, which I also downloaded. I put them in the same directory as FindGpgme.cmake. The main cmake file (FindGpgme.cmake) was found, but MacroEnsureVersion and MacroBoolTo01 not. My change to my CMakeLists.txt was the following:</p>

<pre><code>include(cmake_modules/FindGpgme.cmake)
find_package(Gpgme)
</code></pre>

<p>I tried relative and absolute path to the other files in FindGpgme.cmake. Same problem - cmake can't find them. My second try was with the <a href="https://gitweb.gentoo.org/proj/kde.git/plain/kde-apps/kdepim/files/FindGpgme.cmake?id=d042684fc50129848dff1ab8c75890e2c425b57e" rel="nofollow">file I found on gitweb</a>. The error was:</p>

<pre><code>CMake Error at cmake_modules/FindGpgme.cmake:376 (set_package_properties):
  Unknown CMake command "set_package_properties".
Call Stack (most recent call first):
  CMakeLists.txt:7 (include)
</code></pre>

<p>I have absolutely no glue how to fix that <code>set_package_properties</code> problem.</p>

<hr>

<p><strong>UPDATE 2</strong></p>

<p>I added </p>

<pre><code>include(FeatureSummary)
</code></pre>

<p>to my CMakeLists.txt as proposed by kfunk. Now I get the following error:</p>

<blockquote>
  <p>CMake Warning at CMakeLists.txt:9 (find_package):   By not providing
  "FindGpgme.cmake" in CMAKE_MODULE_PATH this project has  asked CMake
  to find a package configuration file provided by "Gpgme", but   CMake
  did not find one.</p>
  
  <p>Could not find a package configuration file provided by "Gpgme" with
  any of   the following names:</p>

<pre><code>GpgmeConfig.cmake
gpgme-config.cmake
</code></pre>
  
  <p>Add the installation prefix of "Gpgme" to CMAKE_PREFIX_PATH or set<br>
  "Gpgme_DIR" to a directory containing one of the above files.  If
  "Gpgme"   provides a separate development package or SDK, be sure it
  has been   installed.</p>
</blockquote>

<p>Even the message description seams pretty detailed I don't know how to add the FindGpgme.cmake to <code>CMAKE_MODULE_PATH</code> or how to add the requested prefix to <code>CMAKE_PREFIX_PATH</code>. The dev package however is definitely installed (using package manager)</p>