diff --git a/ports/cld3/cld3Config.cmake.in b/ports/cld3/cld3Config.cmake.in new file mode 100644 index 00000000000000..37998eb35b4a3a --- /dev/null +++ b/ports/cld3/cld3Config.cmake.in @@ -0,0 +1,25 @@ +@PACKAGE_INIT@ + +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) + +add_library(cld3 INTERFACE IMPORTED GLOBAL) + +target_include_directories(cld3 INTERFACE ${_cld3_root}/include) + +find_library(cld3_LIBRARIES NAMES cld3) +target_link_libraries(cld3 INTERFACE ${cld3_LIBRARIES}) + +set_property(TARGET cld3 APPEND PROPERTY IMPORTED_CONFIGURATIONS) +set(cld3_FOUND TRUE) + +unset(_cld3_root) diff --git a/ports/cld3/fix-build.patch b/ports/cld3/fix-build.patch index aedb996a828757..dd47e1039f85ae 100644 --- a/ports/cld3/fix-build.patch +++ b/ports/cld3/fix-build.patch @@ -1,7 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2fa3908..1ff7438 100644 +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 ) diff --git a/ports/cld3/portfile.cmake b/ports/cld3/portfile.cmake index 556f3f89af5be0..331cc08f2a5e70 100644 --- a/ports/cld3/portfile.cmake +++ b/ports/cld3/portfile.cmake @@ -31,4 +31,7 @@ file(INSTALL ${HEADERS_SCRIPT_SPAN_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/i 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") diff --git a/versions/c-/cld3.json b/versions/c-/cld3.json index c2587c810fbc67..4d3ab85a64367a 100644 --- a/versions/c-/cld3.json +++ b/versions/c-/cld3.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "26808b5c6093bc32902ccbc035cb4caf8ea20531", + "git-tree": "20d36c1b98aaec110437ed4a4bc301579bef9c34", "version": "3.0.14", "port-version": 0 }