Add support for building with CMake. #617
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tested to work on Windows, Linux and macOS.
The following options
HUNSPELL_BUILD_TOOLS
andHUNSPELL_BUILD_STATIC
are provided to selectively build the hunspell tools (including parsers), as well as the static version of libhunspell, respectively.HUNSPELL_TOOLS_OUTPUT_PREFIX
can be used to add a prefix to the built executables output name, resolving the name conflict issue mentioned in PR #605.The latest Visual Studio generators can be used to generate a multi-config solution on Windows. This renderes the project files already present in source tree under
msvc/
as unnecessary.The
po/
andtest/
directories are not included in the current script, though it can be extended to also processpo
files, as CMake provides modules for handlinggettext
.There is an issue when building hunspell on Mac, where ncurses cannot be found even when installed correctly using homebrew. This is because the CMake package
FindCurses
used to find ncurses fails to find the required libraries and paths. Everything works OK when paths are set manually during configuration. Also worth noting that the latest readline package in homebrew is not compatible with the current code that uses it, due to missing identifiers:rl_delete_text()
,rl_done
,rl_set_key()
. Haven't tried with previous versions of the readline library.The
hunspell.cxx
tool source file was slightly modified to keep the Clang compiler on Apple happy.