EXIV2 FindEXPAT.cmake Can't find library
-
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.
-
@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.
-
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 -
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@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?
-
@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?
-
@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?
@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...
-
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.