<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [PATCH] Libs.private in pkgconfig files"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77947#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [PATCH] Libs.private in pkgconfig files"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77947">bug 77947</a>
              from <span class="vcard"><a class="email" href="mailto:manisandro@gmail.com" title="Sandro Mani <manisandro@gmail.com>"> <span class="fn">Sandro Mani</span></a>
</span></b>
        <pre>So the only other nice option I saw was to read what was passed to
target_link_libraries, do some regex magic and use that in the pc files.
However, looks like there is no way to read the target_link_libraries a
posteriori.... 

So I suppose what one could do is introduce a variable containing what is
passed to target_link_libraries and then filter that to use in the pc files.
Along the lines of i.e.:

set(POPPLER_GLIB_LIBRARIES ${GLIB2_LIBRARIES} ${CAIRO_LIBRARIES}
${FREETYPE_LIBRARIES} -lpthread)

target_link_libraries(poppler-glib poppler ${POPPLER_GLIB_LIBRARIES})

string(REGEX REPLACE <stuff> <stuff> POPPLER_GLIB_LIBRARIES_CLEANED
${POPPLER_GLIB_LIBRARIES})

# In the .pc
Libs.private=@POPPLER_GLIB_LIBRARIES_CLEANED@

Perhaps adding a comment above the target_link_libraries notifying the
developer to add varabiles to POPPLER_XXX_LIBRARIES variable instead of
directly to the target_link_libraries.

Sounds like a plan?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>