diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/liblinear/CMakeLists.txt | |
Diffstat (limited to 'vcpkg/ports/liblinear/CMakeLists.txt')
| -rw-r--r-- | vcpkg/ports/liblinear/CMakeLists.txt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vcpkg/ports/liblinear/CMakeLists.txt b/vcpkg/ports/liblinear/CMakeLists.txt new file mode 100644 index 0000000..093b0f4 --- /dev/null +++ b/vcpkg/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
+ newton.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 newton.h
+ DESTINATION include/liblinear)
+endif()
\ No newline at end of file |