aboutsummaryrefslogtreecommitdiff
path: root/ports/liblinear/CMakeLists.txt
diff options
context:
space:
mode:
authorchausner <chausner@users.noreply.github.com>2018-04-10 19:56:24 +0200
committerRobert Schumacher <roschuma@microsoft.com>2018-04-10 10:56:24 -0700
commiteda41aa2caae4ec0d33f0e372c1f8ff1e2d5dafc (patch)
tree9483c12fd1af0400388dfb494fe49d833a73922d /ports/liblinear/CMakeLists.txt
parent58be8482764c4bae5a62418786b30432a69649aa (diff)
downloadvcpkg-eda41aa2caae4ec0d33f0e372c1f8ff1e2d5dafc.tar.gz
vcpkg-eda41aa2caae4ec0d33f0e372c1f8ff1e2d5dafc.zip
Add liblinear package (#3229)
Diffstat (limited to 'ports/liblinear/CMakeLists.txt')
-rw-r--r--ports/liblinear/CMakeLists.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/ports/liblinear/CMakeLists.txt b/ports/liblinear/CMakeLists.txt
new file mode 100644
index 000000000..6e6928a91
--- /dev/null
+++ b/ports/liblinear/CMakeLists.txt
@@ -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() \ No newline at end of file