Allow to build against packaged version of hunspell library.
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
parent
4c69234334
commit
0c4fe1750f
1 changed files with 53 additions and 42 deletions
95
external/hunspell/CMakeLists.txt
vendored
95
external/hunspell/CMakeLists.txt
vendored
|
|
@ -4,49 +4,60 @@
|
||||||
# For license and copyright information please follow this link:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||||
|
|
||||||
add_library(external_hunspell OBJECT)
|
if (DESKTOP_APP_USE_PACKAGED)
|
||||||
add_library(desktop-app::external_hunspell ALIAS external_hunspell)
|
add_library(external_hunspell INTERFACE IMPORTED)
|
||||||
init_target(external_hunspell "(external)")
|
add_library(desktop-app::external_hunspell ALIAS external_hunspell)
|
||||||
|
|
||||||
set(hunspell_loc ${third_party_loc}/hunspell)
|
find_package(PkgConfig REQUIRED)
|
||||||
set(hunspell_src ${hunspell_loc}/src)
|
pkg_check_modules(HUNSPELL REQUIRED hunspell)
|
||||||
|
|
||||||
nice_target_sources(external_hunspell ${hunspell_src}
|
target_include_directories(external_hunspell INTERFACE ${HUNSPELL_INCLUDE_DIRS})
|
||||||
PRIVATE
|
target_link_libraries(external_hunspell INTERFACE ${HUNSPELL_LIBRARIES})
|
||||||
hunspell/affentry.cxx
|
else()
|
||||||
hunspell/affentry.hxx
|
add_library(external_hunspell OBJECT)
|
||||||
hunspell/affixmgr.cxx
|
add_library(desktop-app::external_hunspell ALIAS external_hunspell)
|
||||||
hunspell/affixmgr.hxx
|
init_target(external_hunspell "(external)")
|
||||||
hunspell/atypes.hxx
|
|
||||||
hunspell/baseaffix.hxx
|
|
||||||
hunspell/csutil.cxx
|
|
||||||
hunspell/csutil.hxx
|
|
||||||
hunspell/filemgr.cxx
|
|
||||||
hunspell/filemgr.hxx
|
|
||||||
hunspell/hashmgr.cxx
|
|
||||||
hunspell/hashmgr.hxx
|
|
||||||
hunspell/htypes.hxx
|
|
||||||
hunspell/hunspell.cxx
|
|
||||||
hunspell/hunspell.h
|
|
||||||
hunspell/hunspell.hxx
|
|
||||||
hunspell/hunvisapi.h
|
|
||||||
hunspell/hunzip.cxx
|
|
||||||
hunspell/hunzip.hxx
|
|
||||||
hunspell/phonet.cxx
|
|
||||||
hunspell/phonet.hxx
|
|
||||||
hunspell/replist.cxx
|
|
||||||
hunspell/replist.hxx
|
|
||||||
hunspell/suggestmgr.cxx
|
|
||||||
hunspell/suggestmgr.hxx
|
|
||||||
hunspell/utf_info.hxx
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(external_hunspell
|
set(hunspell_loc ${third_party_loc}/hunspell)
|
||||||
PUBLIC
|
set(hunspell_src ${hunspell_loc}/src)
|
||||||
${hunspell_src}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(external_hunspell
|
nice_target_sources(external_hunspell ${hunspell_src}
|
||||||
PUBLIC
|
PRIVATE
|
||||||
HUNSPELL_STATIC
|
hunspell/affentry.cxx
|
||||||
)
|
hunspell/affentry.hxx
|
||||||
|
hunspell/affixmgr.cxx
|
||||||
|
hunspell/affixmgr.hxx
|
||||||
|
hunspell/atypes.hxx
|
||||||
|
hunspell/baseaffix.hxx
|
||||||
|
hunspell/csutil.cxx
|
||||||
|
hunspell/csutil.hxx
|
||||||
|
hunspell/filemgr.cxx
|
||||||
|
hunspell/filemgr.hxx
|
||||||
|
hunspell/hashmgr.cxx
|
||||||
|
hunspell/hashmgr.hxx
|
||||||
|
hunspell/htypes.hxx
|
||||||
|
hunspell/hunspell.cxx
|
||||||
|
hunspell/hunspell.h
|
||||||
|
hunspell/hunspell.hxx
|
||||||
|
hunspell/hunvisapi.h
|
||||||
|
hunspell/hunzip.cxx
|
||||||
|
hunspell/hunzip.hxx
|
||||||
|
hunspell/phonet.cxx
|
||||||
|
hunspell/phonet.hxx
|
||||||
|
hunspell/replist.cxx
|
||||||
|
hunspell/replist.hxx
|
||||||
|
hunspell/suggestmgr.cxx
|
||||||
|
hunspell/suggestmgr.hxx
|
||||||
|
hunspell/utf_info.hxx
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(external_hunspell
|
||||||
|
PUBLIC
|
||||||
|
${hunspell_src}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(external_hunspell
|
||||||
|
PUBLIC
|
||||||
|
HUNSPELL_STATIC
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue