Added pkg-config to cmake, which will pick up hunspell installed via brew

This commit is contained in:
guy
2020-06-15 17:19:56 -04:00
parent 516f36a9d2
commit ec02a59a78
+11 -4
View File
@@ -8,11 +8,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(wxWidgets 3 REQUIRED COMPONENTS core base net html) find_package(wxWidgets 3 REQUIRED COMPONENTS core base net html)
find_package(Boost REQUIRED COMPONENTS regex) find_package(Boost REQUIRED COMPONENTS regex)
# find hunspell find_package(PkgConfig)
#find_package(HUNSPELL)
find_path(HUNSPELL_INCLUDE_DIRS hunspell/hunspell.hxx)
find_library(HUNSPELL_LIBRARIES NAMES hunspell libhunspell)
# find hunspell
pkg_check_modules(HUNSPELL hunspell)
if( NOT DEFINED ${HUNSPELL_INCLUDE_DIRS} )
message("-- Cannot find hunspell via pkg-config, checking directly...")
find_path(HUNSPELL_INCLUDE_DIRS hunspell/hunspell.hxx)
find_library(HUNSPELL_LIBRARIES NAMES hunspell libhunspell)
if ( NOT DEFINED ${HUNSPELL_INCLUDE_DIRS} )
message(FATAL_ERROR "Hunspell cannot be found")
endif()
endif()
include_directories("${PROJECT_BINARY_DIR}/src") include_directories("${PROJECT_BINARY_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/src") include_directories("${PROJECT_SOURCE_DIR}/src")