Add liblinear package (#3229)

This commit is contained in:
chausner 2018-04-10 19:56:24 +02:00 committed by Robert Schumacher
parent 58be848276
commit eda41aa2ca
3 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.9)
project(liblinear)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_library(blas OBJECT
blas/daxpy.c
blas/ddot.c
blas/dnrm2.c
blas/dscal.c
)
add_library(liblinear
linear.cpp
tron.cpp
$<TARGET_OBJECTS:blas>
)
target_include_directories(liblinear PRIVATE .)
if(BUILD_SHARED_LIBS)
target_link_libraries(liblinear PRIVATE "-DEF:${CMAKE_CURRENT_SOURCE_DIR}/linear.def")
endif()
add_executable(train train.c $<TARGET_OBJECTS:blas>)
target_link_libraries(train liblinear)
add_executable(predict predict.c $<TARGET_OBJECTS:blas>)
target_link_libraries(predict liblinear)
install(
TARGETS liblinear
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if(NOT DISABLE_INSTALL_TOOLS)
install(
TARGETS train predict
RUNTIME DESTINATION tools/liblinear
)
endif()
if(NOT DISABLE_INSTALL_HEADERS)
install(
FILES linear.h tron.h
DESTINATION include/liblinear)
endif()

3
ports/liblinear/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: liblinear
Version: 2.20
Description: A Library for Large Linear Classification

View File

@ -0,0 +1,26 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cjlin1/liblinear
REF v220
SHA512 cde798b7cb221513cf2b8bbe134d6c3dce1ed26c43504d8c09dbed93b82ca47bfd271d4dd3d03384187273906ce140d4ce4418a4a8c21410015ec1631c1042c6
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/liblinear)
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblinear RENAME copyright)
file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblinear)