[hunspell] Avoid building tools when targetting UWP

This commit is contained in:
Robert Schumacher 2018-10-22 04:00:49 -07:00
parent 7b0ca5d022
commit 2b555061ce
3 changed files with 57 additions and 71 deletions

View File

@ -61,6 +61,11 @@ set(LIBHUNSPELL_HDRS
#hunspell/libhunspell
add_library(libhunspell ${LIBHUNSPELL_HDRS} ${LIBHUNSPELL_SRCS})
target_compile_definitions(libhunspell PRIVATE -DBUILDING_LIBHUNSPELL)
install(TARGETS libhunspell
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
#parsers/libparsers
set(LIBPARSERS_SRCS
@ -93,59 +98,58 @@ set(TESTPARSER_SRCS
src/parsers/odfparser.cxx
)
add_executable(testparser ${TESTPARSER_SRCS})
target_link_libraries(testparser libhunspell)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_BUILD_TYPE STREQUAL "Release")
add_executable(testparser ${TESTPARSER_SRCS})
target_link_libraries(testparser libhunspell)
#tools/analyze
add_executable(analyze "src/tools/analyze.cxx")
target_link_libraries(analyze libhunspell)
#tools/analyze
add_executable(analyze "src/tools/analyze.cxx")
target_link_libraries(analyze libhunspell)
#tools/chmorph
add_executable(chmorph "src/tools/chmorph.cxx" $<TARGET_OBJECTS:libparsers>)
target_link_libraries(chmorph libhunspell)
#tools/chmorph
add_executable(chmorph "src/tools/chmorph.cxx" $<TARGET_OBJECTS:libparsers>)
target_link_libraries(chmorph libhunspell)
#tools/hunspell
include(CheckIncludeFile)
check_include_file("curses.h" HAVE_CURSES_H)
check_include_file("langinfo.h" HAVE_LANGINFO_CODESET)
check_include_file("libintl.h" HAVE_LIBINTL_H)
check_include_file("locale.h" HAVE_LOCALE_H)
check_include_file("ncursesw/curses.h" HAVE_NCURSESW_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
configure_file("config.h.in" "config.h")
#tools/hunspell
include(CheckIncludeFile)
check_include_file("curses.h" HAVE_CURSES_H)
check_include_file("langinfo.h" HAVE_LANGINFO_CODESET)
check_include_file("libintl.h" HAVE_LIBINTL_H)
check_include_file("locale.h" HAVE_LOCALE_H)
check_include_file("ncursesw/curses.h" HAVE_NCURSESW_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
configure_file("config.h.in" "config.h")
add_executable(hunspell "src/tools/hunspell.cxx" $<TARGET_OBJECTS:libparsers>)
target_include_directories(hunspell PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(hunspell libhunspell)
add_executable(hunspell "src/tools/hunspell.cxx" $<TARGET_OBJECTS:libparsers>)
target_include_directories(hunspell PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(hunspell libhunspell)
#tools/munch
add_executable(munch "src/tools/munch.cxx")
#tools/munch
add_executable(munch "src/tools/munch.cxx")
#tools/unmunch
add_executable(unmunch "src/tools/unmunch.cxx")
#tools/unmunch
add_executable(unmunch "src/tools/unmunch.cxx")
#tools/hzip
#add_executable(hzip "src/tools/hzip.cxx")
#target_link_libraries(hzip libhunspell)
#tools/hzip
#add_executable(hzip "src/tools/hzip.cxx")
#target_link_libraries(hzip libhunspell)
#tools/hunzip
add_executable(hunzip "src/tools/hunzip.cxx")
target_link_libraries(hunzip libhunspell)
#tools/hunzip
add_executable(hunzip "src/tools/hunzip.cxx")
target_link_libraries(hunzip libhunspell)
install(
TARGETS
libhunspell
hunspell
testparser
analyze
chmorph
munch
unmunch
# hzip
hunzip
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(
TARGETS
hunspell
testparser
analyze
chmorph
munch
unmunch
# hzip
hunzip
DESTINATION tools/hunspell
)
endif()
install(FILES ${LIBHUNSPELL_HDRS} DESTINATION "include/hunspell/")

View File

@ -1,3 +1,3 @@
Source: hunspell
Version: 1.6.1-2
Version: 1.6.1-3
Description: The most popular spellchecking library.

View File

@ -1,18 +1,12 @@
include(vcpkg_common_functions)
set(HUNSPELL_VERSION 1.6.1)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hunspell-${HUNSPELL_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/hunspell/hunspell/archive/v${HUNSPELL_VERSION}.zip"
FILENAME "hunspell-${HUNSPELL_VERSION}.zip"
SHA512 164eb1ae9ff9f4d8efe8998fa3ad847bf5a0c1a87113acc52dcdb3aaddb4e9179274585623bd7152f9a82b803bd42ce24fe856ac8d49121214bef59ac1c7753c
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/0001_fix_unistd.patch
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO hunspell/hunspell
REF v1.6.1
SHA512 39b096ec1f5226f13eaf241647fc9b49a6dad04945ae0bcdc61ba845d66d67d64a72ba4287b6f376b5ad053b5d0e1d42a42415c30521c50693f0544718029458
HEAD_REF master
PATCHES 0001_fix_unistd.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
@ -23,24 +17,13 @@ vcpkg_configure_cmake(
PREFER_NINJA
)
vcpkg_build_cmake()
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(GLOB_RECURSE TOOLS_RELEASE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(GLOB_RECURSE TOOLS_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(COPY ${TOOLS_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(REMOVE ${TOOLS_RELEASE} ${TOOLS_DEBUG})
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/hunspell)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING ${CURRENT_PACKAGES_DIR}/share/hunspell/copyright)
@ -49,4 +32,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING.LESSER ${CURRENT_PACK
file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/hunspell)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING.MPL ${CURRENT_PACKAGES_DIR}/share/hunspell/copyright-mpl)