decuser
(Will Senn)
December 12, 2021, 6:39pm
1
The actual error message is:
Could NOT find HUNSPELL: Found unsuitable version "", but required is at
least "1.6" (found /usr/local/lib/libhunspell-1.6.dylib)
From the message, it seems that the library is being found, but that:
Cmake isn’t detecting the version properly
hunspell isn’t reporting the version properly
I can’t tell which (I’m not an expert in either cmake or hunspell). Has anyone seen an empty version string “” before, and if so, what was the fix?
ben.boeckel
(Ben Boeckel (Kitware))
December 12, 2021, 9:26pm
2
FindHUNSPELL
doesn’t seem to come with CMake. Where is the module from?
decuser
(Will Senn)
December 12, 2021, 11:18pm
3
hunspell is a spell checking library that is being used in the project.
ben.boeckel
(Ben Boeckel (Kitware))
December 12, 2021, 11:22pm
4
I know what hunspell is, but this error is coming from some file that is not provided by CMake itself. What file is providing the code which is looking for hunspell?
decuser
(Will Senn)
December 12, 2021, 11:35pm
5
If I understand what you’re asking. I’m compiling FeatherPad (GitHub - tsujan/FeatherPad: Lightweight Qt Plain-Text Editor for Linux )
It has a file FindHUNSPELL.cmake containing:
find_package(PkgConfig)
pkg_check_modules(PKG_HUNSPELL QUIET hunspell)
find_path(HUNSPELL_INCLUDE_DIRS
NAMES hunspell.hxx
PATH_SUFFIXES hunspell
HINTS ${PKG_HUNSPELL_INCLUDE_DIRS})
find_library(HUNSPELL_LIBRARIES
NAMES ${PKG_HUNSPELL_LIBRARIES} hunspell hunspell-1.8 hunspell-1.7 hunspell-1.6 libhunspell
HINTS ${PKG_HUNSPELL_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HUNSPELL
REQUIRED_VARS HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIRS
VERSION_VAR PKG_HUNSPELL_VERSION)
mark_as_advanced(HUNSPELL_INCLUDE_DIRS HUNSPELL_LIBRARIES)
ben.boeckel
(Ben Boeckel (Kitware))
December 13, 2021, 1:18pm
6
Hmm. It seems that PKG_HUNSPELL_VERSION
is not being extracted properly somehow? Could you provide the output of cmake --trace-expand
related to that pkg_check_modules()
call? Something isn’t working there it seems.
decuser
(Will Senn)
December 13, 2021, 2:41pm
8
Trying this again - here’s a link:
cmake-trace-hunspell.txt
$ cd /build/FeatherPad/
$ cmake --trace-expand
Running with expanded trace output on.
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
/build/FeatherPad/CMakeLists.txt(1): project(featherpad )
This file has been truncated. show original
ben.boeckel
(Ben Boeckel (Kitware))
December 13, 2021, 10:42pm
9
Sorry, I wasn’t clear. The flag needs to be added to whatever else you give when configuring, probably just the binary directory.
decuser
(Will Senn)
December 14, 2021, 12:31am
10
Hi Ben, I’m not sure what you’re asking. To build this project, generally, I just open CMakeLists.txt in QT Creator and build the project in QT Creator. The gist shows the trace and error in more detail that what QT Creator shows.
ben.boeckel
(Ben Boeckel (Kitware))
January 2, 2022, 5:33pm
11
It looks like FindPkgConfig
is not getting the version from the hunspell package properly. What does the .pc
file for it look like?