Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using poppler-qt6 for qt project on macOS
QtWS25 Last Chance

Using poppler-qt6 for qt project on macOS

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 488 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BushyAxis793
    wrote on last edited by
    #1

    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:

    9238bfef-315b-47b0-805d-b485140b9fc8-image.png

    What should I do to solve this problem? I try to add path to poppler installation but not result:

    4e6b1f4f-c9ee-4620-8fbf-2b5a5925ff77-image.png

    Any tips?

    Have a good day

    JoeCFDJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One possible way: use KDE's ecm package that provides a CMake find module for Poppler.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        One possible way: use KDE's ecm package that provides a CMake find module for Poppler.

        B Offline
        B Offline
        BushyAxis793
        wrote on last edited by
        #3

        @SGaist I think I have no idea how to use your solution. Is there any simpler way to use poppler in qt creator project?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply
          0
          • B BushyAxis793

            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:

            9238bfef-315b-47b0-805d-b485140b9fc8-image.png

            What should I do to solve this problem? I try to add path to poppler installation but not result:

            4e6b1f4f-c9ee-4620-8fbf-2b5a5925ff77-image.png

            Any tips?

            Have a good day

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #5

            @BushyAxis793 can you try
            export Poppler_Dir=installdir/cmake

            The installed poppler has a cmake dir.

            1 Reply Last reply
            0
            • SGaistS SGaist

              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 ?

              B Offline
              B Offline
              BushyAxis793
              wrote on last edited by
              #6

              @SGaist No, I did not install extra-cmake-modules formula

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                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.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved