mirror of https://github.com/microsoft/vcpkg.git
[cld3] New Port (#33312)
* [cld3] new port * [cld3] fix port version * update a path to the license * use vcpkg_install_cmake * remove deprecated functions * disable arm test * update sha * ci.baseline.txt * Update scripts/ci.baseline.txt Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * Update ports/cld3/vcpkg.json Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * Update ports/cld3/portfile.cmake Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * fix version * scripts/ci.baseline.txt * update patch * c++ 11 version * disable 64-osx * more patches * fix linux/Win32 static only * anable other platforms * fix build * x64-osx * ci.baseline.txt * Revert "ci.baseline.txt" This reverts commit ade1499c0f70c5171759c5330f0b8ba7394b3438. * Update ports/cld3/portfile.cmake Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * fix version * remove unused vcpkg-cmake-config * move install headers to portfile * remove ABI version * add LF to ci.baseline.txt * scripts/ci.baseline.txt * disable unit tests * fix * move COMPILER_MSVC to port file * fix version * add line break * refactoring * uncomment -D_GLIBCXX_USE_CXX11_ABI=0 * add cld3Config.cmake.in * improve cld3Config.cmake.in --------- Co-authored-by: Alexander ROZDAYBEDA <alexander.rozdaybeda@avanquest.com> Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>
This commit is contained in:
parent
977cb05b44
commit
fd675b7b81
|
|
@ -0,0 +1,39 @@
|
|||
if(TARGET cld3)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Protobuf)
|
||||
|
||||
# Traditional find module variables (vcpkg polyfill)
|
||||
set(cld3_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
set(cld3_INCLUDE_DIRS "${cld3_INCLUDE_DIR}")
|
||||
set(cld3_DIR "${cld3_INCLUDE_DIR}")
|
||||
|
||||
get_filename_component(_cld3_root "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_cld3_root "${_cld3_root}" PATH)
|
||||
get_filename_component(_cld3_root "${_cld3_root}" PATH)
|
||||
|
||||
find_library(_cld_lib NAMES cld3)
|
||||
if (EXISTS "${_cld_lib}")
|
||||
|
||||
add_library(cld3 INTERFACE IMPORTED GLOBAL)
|
||||
add_library(cld3::cld3 ALIAS cld3)
|
||||
|
||||
target_include_directories(cld3 INTERFACE ${_cld3_root}/include)
|
||||
|
||||
set(cld3_LIBRARIES "${_cld_lib}")
|
||||
target_link_libraries(cld3 INTERFACE ${cld3_LIBRARIES})
|
||||
target_link_libraries(cld3 INTERFACE ${Protobuf_LITE_LIBRARIES})
|
||||
|
||||
set_property(TARGET cld3 APPEND PROPERTY IMPORTED_CONFIGURATIONS)
|
||||
set(cld3_FOUND TRUE)
|
||||
|
||||
else()
|
||||
|
||||
set(cld3_FOUND FALSE)
|
||||
|
||||
endif()
|
||||
|
||||
unset(_cld_lib)
|
||||
unset(_cld3_root)
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2fa3908..f6d26cb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -21,7 +21,7 @@ my_protobuf_generate_cpp(cld_3/protos PROTO_SRCS PROTO_HDRS src/feature_extracto
|
||||
message(STATUS "PROTO_HDRS= ${PROTO_HDRS}")
|
||||
|
||||
add_definitions(-fPIC) # Position Independant Code
|
||||
-add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
||||
+#add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
||||
add_definitions(-std=c++11) # Needed for std::to_string(), ...
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${Protobuf_INCLUDE_DIRS}) # needed to include generated pb headers
|
||||
@@ -58,6 +58,13 @@ add_library(${PROJECT_NAME}
|
||||
src/script_span/fixunicodevalue.cc
|
||||
)
|
||||
|
||||
+if (MSVC)
|
||||
+ add_compile_definitions(COMPILER_MSVC)
|
||||
+endif()
|
||||
+
|
||||
+install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
|
||||
+return()
|
||||
+
|
||||
# unit tests exec:
|
||||
add_executable(language_identifier_main src/language_identifier_main.cc)
|
||||
target_link_libraries(language_identifier_main cld3 ${Protobuf_LITE_LIBRARIES})
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/cld3
|
||||
REF b48dc46512566f5a2d41118c8c1116c4f96dc661
|
||||
SHA512 c3650ffbf5855aaf04d03930f01c6efd76e1f2b2d47365348721f16531a14653ae5b3aff8fefa8e5fa1c769fdf1a9b441a88bc687f97f8c579b84f17c6984c9e
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-build.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
-DINSTALL_LIB_DIR:STRING=lib
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(GLOB PUBLIC_HEADER_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/src/*.h")
|
||||
file(INSTALL ${PUBLIC_HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/cld3")
|
||||
|
||||
file(GLOB HEADERS_SCRIPT_SPAN_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/src/script_span/*.h")
|
||||
file(INSTALL ${HEADERS_SCRIPT_SPAN_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/cld3/script_span")
|
||||
|
||||
file(GLOB HEADERS_PROTO_FILES LIST_DIRECTORIES false "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/cld_3/protos/*.h")
|
||||
file(INSTALL ${HEADERS_PROTO_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/cld_3/protos")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cld3Config.cmake.in"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/cld3Config.cmake" @ONLY)
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "cld3",
|
||||
"version": "3.0.14",
|
||||
"description": "Compact Language Detector v3",
|
||||
"homepage": "https://github.com/google/cld3",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": [
|
||||
"protobuf",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1628,6 +1628,10 @@
|
|||
"baseline": "1.6.1",
|
||||
"port-version": 0
|
||||
},
|
||||
"cld3": {
|
||||
"baseline": "3.0.14",
|
||||
"port-version": 0
|
||||
},
|
||||
"clfft": {
|
||||
"baseline": "2.12.2",
|
||||
"port-version": 6
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "188a3b8fe8c84224f44d3d88b4e74ca34363cf9b",
|
||||
"version": "3.0.14",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue