Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building with CMake. #617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pzmarius
Copy link

Tested to work on Windows, Linux and macOS.

The following options HUNSPELL_BUILD_TOOLS and HUNSPELL_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/ and test/ directories are not included in the current script, though it can be extended to also process po files, as CMake provides modules for handling gettext.

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.

Copy link

@trailblazing trailblazing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. src/hunspell/CMakeLists.txt:92
    # $<$<CXX_COMPILER_ID:Clang>:-Wl,-no-undefined,error>
    This setting does not work on Void Linux (Clang, musl). It's not necessary for this toolchain.

  2. src/hunspell/CMakeLists.txt:101
    VERSION 0.0.${PROJECT_VERSION_PATCH} # ${PROJECT_VERSION}
    If I set project version to 1.7.2, the patch version would be 2. We will get "libhunspell-1.7.so.0.0.2". Otherwise from the original version setting we got "libhunspell-1.7.so.1.7.0"

  3. src/hunspell/CMakeLists.txt:161
    VERSION 0.0.${PROJECT_VERSION_PATCH} # ${PROJECT_VERSION}
    Same as above.

@zdenop
Copy link

zdenop commented Oct 13, 2021

pls. merge also this and 704...

@zdenop
Copy link

zdenop commented Nov 25, 2022

@caolanm: please can you merge this?

@zdenop
Copy link

zdenop commented Dec 29, 2022

as version v1.7.2 was released - can you please add this cmake support, so we can improve it? e.g we can remove https://github.com/hunspell/hunspell/tree/master/msvc afterwords...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants