title: External library specific COMPILE_DEFINITIONS in cmake
body: <p>I've written a cmake module for finding QCustomPlot. However, to use the shared library, one needs to #define QCUSTOMPLOT_USE_LIBRARY. I'd like to provide this define through cmake, automatically adding the definition to any project that uses QCustomPlot.</p>
  
  <p>Here is a snippet of my cmake module and my current attempted solution:</p>
  
  <pre><code>SET(QCP_FOUND "NO")
  IF(QCP_LIBRARY AND QCP_INCLUDE_DIR)
    SET(QCP_FOUND "YES")
    SET_PROPERTY(
      GLOBAL
      APPEND
      PROPERTY COMPILE_DEFINITIONS QCUSTOMPLOT_USE_LIBRARY
      )
  ENDIF(QCP_LIBRARY AND QCP_INCLUDE_DIR)
  </code></pre>
  
  <p>However, no linkers append the -DQCUSTOMPLOT_USE_LIBRARY flag in my compilations. What's the right way to approach this problem?</p>