2021.03.06 22:59 "Re: [Tiff] Libdeflate not found ?", by Miguel Medalha
Thank you for your answer.
If you haven’t done so already, I would suggest deleting CMakeCache.txt and re-running CMake to check it discovers libdeflate properly. If it doesn’t, maybe there’s some additional portability work required.
I deleted not only CMakeCache.txt but the whole build dir, in order to start afresh.
All the external codec libraries are located in ‘C:\build\lib’ and all the header files are in ‘C:\build\include’. Only libdeflate is not found.
If I specify its location with:
-DDEFLATE_LIBRARY:FILEPATH=C:\build\lib\libdeflatestatic.lib -DDEFLATE_INCLUDE_DIR:PATH=C:\build\include
It is still not found. CMake gives:
Manually-specified variables were not used by the project:
DEFLATE_INCLUDE_DIR
DEFLATE_LIBRARY
But the library is found with (note the lowercase in “–Ddeflate”):
-DDeflate_LIBRARY:FILEPATH=C:\build\lib\libdeflatestatic.lib -DDEFLATE_INCLUDE_DIR:PATH=C:\build\include
Why the lowercase in this particular case only?
I ran CMake with (for auto find):
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_C_FLAGS:STRING="-O2 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE" -DCMAKE_STATIC_LIBRARY_SUFFIX_C=-static.lib -Dccitt:BOOL=ON -Dpackbits:BOOL=ON -Dlzw:BOOL=ON -Dthunder:BOOL=ON -Dnext:BOOL=ON -Dlogluv:BOOL=ON -Dzlib:BOOL=ON -Dlibdeflate:BOOL=ON -Dpixarlog:BOOL=ON -Djpeg:BOOL=ON -Dold-jpeg:BOOL=ON -Djpeg12:BOOL=OFF -Djbig:BOOL=ON -Dlzma:BOOL=OFF -Dzstd:BOOL=OFF -Dwebp:BOOL=OFF -DCMAKE_SHARED_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -DCMAKE_STATIC_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -DCMAKE_EXE_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -S C:\build\git\libtiff -B C:\build\bin\libtiff
And then with:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_C_FLAGS:STRING="-O2 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE" -DCMAKE_STATIC_LIBRARY_SUFFIX_C=-static.lib -DZLIB_LIBRARY:FILEPATH=C:\build\lib\zlibstatic.lib -DZLIB_INCLUDE_DIR:PATH=C:\build\include -DDEFLATE_LIBRARY:FILEPATH=C:\build\lib\libdeflatestatic.lib -DDEFLATE_INCLUDE_DIR:PATH=C:\build\include -DJPEG_LIBRARY:FILEPATH=C:\build\lib\turbojpeg-static.lib -DJPEG_INCLUDE_DIR:PATH=C:\build\include -DJBIG_LIBRARY:FILEPATH=C:\build\lib\libjbig.lib -DJBIG_INCLUDE_DIR:PATH=C:\build\include -Dccitt:BOOL=ON -Dpackbits:BOOL=ON -Dlzw:BOOL=ON -Dthunder:BOOL=ON -Dnext:BOOL=ON -Dlogluv:BOOL=ON -Dzlib:BOOL=ON -Dlibdeflate:BOOL=ON -Dpixarlog:BOOL=ON -Djpeg:BOOL=ON -Dold-jpeg:BOOL=ON -Djpeg12:BOOL=OFF -Djbig:BOOL=ON -Dlzma:BOOL=OFF -Dzstd:BOOL=OFF -Dwebp:BOOL=OFF -DCMAKE_SHARED_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -DCMAKE_STATIC_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -DCMAKE_EXE_LINKER_FLAGS="/NODEFAULTLIB:LIBCMT /machine:x64" -S C:\build\git\libtiff -B C:\build\bin\libtiff