Using poppler-qt6 for qt project on macOS
-
Hello,
I want to add to my application pdf viewer. I found information that poppler should be good for this. So I decided to use it.
I use homebrew to install poppler and qt:
brew install poppler
brew install qt
Next I added to my project CMakeList.txt lines:
find_package(Poppler REQUIRED) find_package(Qt6 COMPONENTS Widgets REQUIRED) add_executable(myapp main.cpp) target_link_libraries(myapp PRIVATE Poppler::Qt6 Qt6::Widgets)
Where my app is name of my project
And I got an error:
What should I do to solve this problem? I try to add path to poppler installation but not result:
Any tips?
Have a good day
-
Hi,
One possible way: use KDE's ecm package that provides a CMake find module for Poppler.
-
It has nothing to do with Qt Creator, you are using CMake to manage your project.
Since you are already using brew, did you install the
extra-cmake-modules formula ? -
@BushyAxis793 can you try
export Poppler_Dir=installdir/cmakeThe installed poppler has a cmake dir.
-
Then it's a good first step so you will get these extra find modules for cmake which contains one for poppler.
Otherwise, use CMake's find_library and find_path functions.