[poppler] cmake issues

Albert Astals Cid aacid at kde.org
Sun Sep 3 20:42:27 UTC 2017


El diumenge, 3 de setembre de 2017, a les 14:24:16 CEST, Adrian Johnson va 
escriure:
> On 03/09/17 01:45, Albert Astals Cid wrote:
> > El dissabte, 2 de setembre de 2017, a les 22:34:04 CEST, Adrian Johnson va
> > 
> > escriure:
> >> As the autotools build will be dropped I've been gaining more experience
> >> with the cmake build. I've found a few problems:
> >> 
> >> 1) Is there any way to selectively disable the fontends? If I'm working
> >> on core I like to minimize the rebuild times.
> > 
> > Not really, the "command line options" we support are around the
> > 
> >   # command line switches
> > 
> > of CMakeLists.txt. What I do when i don't want to rebuild everything is
> > just type make poppler for the lib or make pdfinfo so that pdfinfo (and
> > the lib) get recompiled.
> > 
> > If configure supports this and you really think it's a must i guess we
> > could add it, but I personally think its a good idea to have a build with
> > everything configured, build selectively what you want (i.e. make
> > pdfinfo) and then just run a final make to make sure you didn't break
> > something else by chance.> 
> >> 2) I usually install cairo git and poppler git to their own prefix for
> >> testing. I compile popper with PKG_CONFIG_PATH set to this location so
> >> it will link with cairo git. poppler-glib-demo is failing to link with
> >> cairo. pdftocairo links fine. I noticed this because there is some new
> >> API in cairo git and I have a poppler branch with support for this API.
> >> 
> >> The problem is the poppler-glib-demo link command lists "-lcairo" then
> >> the libcairo.so.
> > 
> > you mean it's there twice? one as -lcairo and one as libcairo.so?
> > 
> >> Manually running the link command without "-lcairo" (or
> >> even just putting it after the libcairo.so) fixes the linking. The
> >> pdftocairo link command does not have "-lcairo".
> >> 
> >> I don't know how to fix this in cmake. I assume it is the linking with
> >> gtk3 that is adding the -lcairo. I tried adding ${CAIRO_LIBRARIES}
> >> before ${GTK3_LIBRARIES} in glib/demo/CMakeLists.txt but it still fails
> >> to link.
> > 
> > does changing
> > 
> >   target_link_libraries(poppler-glib-demo poppler-glib ${GTK3_LIBRARIES})
> > 
> > to
> > 
> >   target_link_libraries(poppler-glib-demo ${GTK3_LIBRARIES} poppler-glib)
> > 
> > help?
> 
> I managed to get it working. See attached patch. The problem seems to be
> that pkg_check_modules does not return the absolute path of the shared
> libraries. There is a bug for this at
> https://cmake.org/Bug/view.php?id=15804.
> 
> Is there a better way to handle this?

That's a really weird patch, cna you tell me exactly how is your setup so i 
can try reproducing the problem you have?

Cheers,
  Albert

> 
> >> 3) What is the preferred way to run cmake. In the top level dir? Or
> >> create a build dir and run it in that? If I build in the top level dir,
> >> git status shows a lot of build noise that has not been added to
> >> .gitignore. I have to run git clean to clean it up. Whichever way is
> >> best we should add the build output to .gitignore to hide it from git
> >> status.
> > 
> > Yeah it's better just to create a build directory and run cmake .., this
> > way you can just nuke the builddir altogether if you want to make sure
> > you're running something totally clean. Some projects go to the extreme
> > of forbidding a buildroot equal to the sourceroot (I think there's a
> > relatively easy way to do that in cmake) but i don't think we need to be
> > that extreme, no?
> > 
> > Cheers,
> > 
> >   Albert
> >> 
> >> _______________________________________________
> >> poppler mailing list
> >> poppler at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/poppler




More information about the poppler mailing list