diff --git a/vcpkg_overlays/nlp-engine/CMakeLists.txt b/vcpkg_overlays/nlp-engine/CMakeLists.txt new file mode 100644 index 00000000000..66dd00be7e8 --- /dev/null +++ b/vcpkg_overlays/nlp-engine/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.15) + +# set the project name and version +project(nlp-engine) + +set(CMAKE_CXX_STANDARD 17) + +find_package(ICU REQUIRED COMPONENTS data i18n io tu uc) + +include_directories(cs/include) +include_directories(include) +include_directories(include/Api) +include_directories(include/Api/lite) +include_directories(${ICU_INCLUDE_DIRS}) + +add_subdirectory(cs) +add_subdirectory(src) + +install(DIRECTORY "${CMAKE_SOURCE_DIR}/include" DESTINATION "." FILES_MATCHING PATTERN "*.h") + +add_definitions( -DLITE_EXPORTS ) +if(WIN32) + add_definitions( -DMSVC_VERSION=${MSVC_VERSION} -D_CRT_SECURE_NO_WARNINGS ) +else() + add_definitions( -DLINUX -Wno-write-strings -Wno-deprecated ) +endif() + +file(GLOB lite_src "lite/*.h" "lite/*.cpp") +add_library(nlp-engine SHARED ${lite_src}) +target_link_libraries(nlp-engine PRIVATE + prim + kbm + consh + words + ${ICU_LIBRARIES} +) + +target_include_directories(nlp-engine + INTERFACE + $ + $ + $ +) + +install(TARGETS nlp-engine + EXPORT nlp-engine-config + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(EXPORT nlp-engine-config + FILE nlp-engine-config.cmake + DESTINATION share/cmake/nlp-engine +) + +install( + DIRECTORY ./analyzers + DESTINATION share/nlp-engine + COMPONENT Runtime +) + +install( + DIRECTORY ./data + DESTINATION share/nlp-engine + COMPONENT Runtime +) diff --git a/vcpkg_overlays/nlp-engine/portfile.cmake b/vcpkg_overlays/nlp-engine/portfile.cmake new file mode 100644 index 00000000000..ae931ff004c --- /dev/null +++ b/vcpkg_overlays/nlp-engine/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO VisualText/nlp-engine + REF v${VERSION} + SHA512 a6871cb3db10a1d4bd7d5290141a82e788269da28b2d995963825dc4c50025e6099f5f872e4538054b7fb169773b6d6d3e73e3dd102bc3e0cbb5bddcd95ae484 + HEAD_REF master +) + +vcpkg_from_github( + OUT_SOURCE_PATH ANALYZER_PATH + REPO VisualText/analyzers + REF v1.6.2 + SHA512 07479c8ba1f36c3a0bb035af7414e96ce1477ffaa8a276256fc3749d169c0bb99f9ac9ad5c9b5b0868d634644013c46643a90598dd465e4f16bbe82a47ac60fe + HEAD_REF master +) + +vcpkg_from_github( + OUT_SOURCE_PATH PARSE_EN_US_PATH + REPO VisualText/parse-en-us + REF v1.1.1 + SHA512 1aa01c0befe82b8fe415576ae992b0b60fe51b816e93fd8f45da4c5ccacc3dc87c21373ba001cf0d0c503131b4b83346e86f1522795901bbceb07c63a52d6294 + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY "${ANALYZER_PATH}/." DESTINATION "${SOURCE_PATH}/analyzers" PATTERN "*.*") +file(COPY "${PARSE_EN_US_PATH}/." DESTINATION "${SOURCE_PATH}/analyzers/parse-en-us" PATTERN "*.*") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME "nlp-engine" CONFIG_PATH "share/cmake/nlp-engine") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg_overlays/nlp-engine/vcpkg.json b/vcpkg_overlays/nlp-engine/vcpkg.json new file mode 100644 index 00000000000..f58aab2fe7b --- /dev/null +++ b/vcpkg_overlays/nlp-engine/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "nlp-engine", + "version-semver": "2.10.6", + "port-version": 0, + "homepage": "https://github.com/VisualText/nlp-engine", + "description": "The NLP engine is a cross-platform text analysis tool that can be accessed through a command line executable or by calling its C++ functions from another language.", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + { + "name": "icu", + "features": [ + "tools" + ] + } + ] +} \ No newline at end of file