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. EXIV2 FindEXPAT.cmake Can't find library
Forum Updated to NodeBB v4.3 + New Features

EXIV2 FindEXPAT.cmake Can't find library

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Simplexity
    wrote on last edited by
    #1

    Trying to build EXIV2 from GitHub for windows using Qt 7.0.2.

    EXIV2 needs EXPAT. My expat header and dll are in the directory D:/b-qgis-external/expat (expat.h and libexpatd.dll).

    I modified the FindEXPAT.cmake file to add HINTS to my directory:
    find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS} D:/b-qgis-external/expat)

    find_library(EXPAT_LIBRARY NAMES expat libexpat NAMES_PER_DIR HINTS ${PC_EXPAT_LIBRARY_DIRS} D:/b-qgis-external/expat)

    CMake finds the header, but does not seem to find the library (.dll) ??

    Qt Issues output:
    D:\Qt\Tools\CMake_64\share\cmake-3.23\Modules\FindPackageHandleStandardArgs.cmake:232: error: Could NOT find EXPAT (missing: EXPAT_LIBRARY) (found version "2.4.8") D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:596 (_FPHSA_FAILURE_MESSAGE) D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindEXPAT.cmake:66 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/findDependencies.cmake:59 (find_package) CMakeLists.txt:74 (include)
    :-1: error: CMake process exited with exit code 1.
    :-1: error: No CMake configuration found!

    General Messages Output:

    Running D:\Qt\Tools\CMake_64\bin\cmake.exe -S D:/d-qtgithub-proj/exiv2-recursive/exiv2 -B D:/d-qtgithub-proj/exiv2-recursive/build-exiv2-Desktop_Qt_6_3_1_MinGW_64_bit-Debug in D:\d-qtgithub-proj\exiv2-recursive\build-exiv2-Desktop_Qt_6_3_1_MinGW_64_bit-Debug.
    CMake Warning at D:/Qt/Tools/QtCreator/share/qtcreator/package-manager/auto-setup.cmake:62 (message):
    Qt Creator: conan executable not found. Package manager auto-setup will be
    skipped. To disable this warning set QT_CREATOR_SKIP_CONAN_SETUP to ON.
    Call Stack (most recent call first):
    D:/Qt/Tools/QtCreator/share/qtcreator/package-manager/auto-setup.cmake:134 (qtc_auto_setup_conan)
    CMakeLists.txt:4 (project)

    CMake Warning at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:213 (message):
    Started FindPackageHandleStandardArgs
    Call Stack (most recent call first):
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPython/Support.cmake:34 (include)
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPython3.cmake:490 (include)
    cmake/findDependencies.cmake:33 (find_package)
    CMakeLists.txt:74 (include)

    CMake Warning at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindZLIB.cmake:59 (message):
    Started FindZLIB.cmake
    Call Stack (most recent call first):
    cmake/findDependencies.cmake:46 (find_package)
    CMakeLists.txt:74 (include)

    CMake Warning at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:213 (message):
    Started FindPackageHandleStandardArgs
    Call Stack (most recent call first):
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindZLIB.cmake:124 (include)
    cmake/findDependencies.cmake:46 (find_package)
    CMakeLists.txt:74 (include)

    CMake Warning at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:213 (message):
    Started FindPackageHandleStandardArgs
    Call Stack (most recent call first):
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPkgConfig.cmake:98 (include)
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindEXPAT.cmake:35 (find_package)
    cmake/findDependencies.cmake:59 (find_package)
    CMakeLists.txt:74 (include)

    -- Configuring incomplete, errors occurred!
    See also "D:/d-qtgithub-proj/exiv2-recursive/build-exiv2-Desktop_Qt_6_3_1_MinGW_64_bit-Debug/CMakeFiles/CMakeOutput.log".
    CMake Warning at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:213 (message):
    Started FindPackageHandleStandardArgs
    Call Stack (most recent call first):
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindEXPAT.cmake:65 (include)
    cmake/findDependencies.cmake:59 (find_package)
    CMakeLists.txt:74 (include)

    CMake Error at D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:232 (message):
    Could NOT find EXPAT (missing: EXPAT_LIBRARY) (found version "2.4.8")
    Call Stack (most recent call first):
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:596 (_FPHSA_FAILURE_MESSAGE)
    D:/Qt/Tools/CMake_64/share/cmake-3.23/Modules/FindEXPAT.cmake:66 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    cmake/findDependencies.cmake:59 (find_package)
    CMakeLists.txt:74 (include)

    CMake process exited with exit code 1.

    Elapsed time: 00:01.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @Simplexity said in EXIV2 FindEXPAT.cmake Can't find library:

      Trying to build EXIV2 from GitHub for windows using Qt 7.0.2.

      No, you are trying to build Exiv2 with GCC and CMake. Not really anything to do with the Qt library.

      CMake finds the header, but does not seem to find the library (.dll) ??

      The header is there. CMake is, presumably, looking for a link library that is not there. QGis is almost certainly not providing and entire Exiv2 development

      Download, build and install Exiv2 with GCC and you should find all the relevant components.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Simplexity
        wrote on last edited by
        #3

        I meant to say building with QtCreator v 7.0.2
        EXIV2 is a dependency of QGIS.
        EXPAT is a dependency of EXIV2.

        I have modified FindEXPAT.cmake to set the include and library paths as follows:

        set(EXPAT_INCLUDE_DIR D:/b-qgis-external/expat/)
        set(EXPAT_LIBRARY D:/b-qgis-external/expat/)

        CMake parses the cmake files ok now. But when I build I get the errors:

        :-1: error: cannot find D:/b-qgis-external/expat/: Permission denied
        :-1: error: cannot find D:/b-qgis-external/expat/: Permission denied
        :-1: error: collect2.exe: error: ld returned 1 exit status

        jsulmJ 1 Reply Last reply
        0
        • S Simplexity

          I meant to say building with QtCreator v 7.0.2
          EXIV2 is a dependency of QGIS.
          EXPAT is a dependency of EXIV2.

          I have modified FindEXPAT.cmake to set the include and library paths as follows:

          set(EXPAT_INCLUDE_DIR D:/b-qgis-external/expat/)
          set(EXPAT_LIBRARY D:/b-qgis-external/expat/)

          CMake parses the cmake files ok now. But when I build I get the errors:

          :-1: error: cannot find D:/b-qgis-external/expat/: Permission denied
          :-1: error: cannot find D:/b-qgis-external/expat/: Permission denied
          :-1: error: collect2.exe: error: ld returned 1 exit status

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Simplexity said in EXIV2 FindEXPAT.cmake Can't find library:

          D:/b-qgis-external/expat/: Permission denied

          So, do you have access rights in that folder?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @Simplexity said in EXIV2 FindEXPAT.cmake Can't find library:

            set(EXPAT_INCLUDE_DIR D:/b-qgis-external/expat/)

            Is the trailing slash the problem?

            jsulmJ 1 Reply Last reply
            0
            • C ChrisW67

              @Simplexity said in EXIV2 FindEXPAT.cmake Can't find library:

              set(EXPAT_INCLUDE_DIR D:/b-qgis-external/expat/)

              Is the trailing slash the problem?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @ChrisW67 said in EXIV2 FindEXPAT.cmake Can't find library:

              Is the trailing slash the problem?

              I don't think so, but easy to test.

              You did not answer the question...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Simplexity
                wrote on last edited by
                #7

                The problem was my assumptions about how cmake's FIND_LIBRARY and FIND_PATH work. My errors were in how I wrote these CMake finds.

                CMAKE requires the whole name of the header and library file, not just a part of it as I assumed.

                Now using:
                FIND_PATH(EXPAT_INCLUDE_DIR headername.h HINTS D:/b-qgis-external/expat)
                FIND_LIBRARY(EXPAT_LIBRARY NAMES expatd HINTS D:/b-qgis-external/expat)

                Thanks for the help.

                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