mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 20:32:00 +08:00
commit
426df16b57
55
ports/matio/CMakeLists.txt
Normal file
55
ports/matio/CMakeLists.txt
Normal file
@ -0,0 +1,55 @@
|
||||
cmake_minimum_required(VERSION 3.8.0)
|
||||
project(libmatio C)
|
||||
|
||||
set(SRC
|
||||
src/endian.c
|
||||
src/inflate.c
|
||||
src/io.c
|
||||
src/mat.c
|
||||
src/mat4.c
|
||||
src/mat5.c
|
||||
src/mat73.c
|
||||
visual_studio/matio.def
|
||||
src/matvar_cell.c
|
||||
src/matvar_struct.c
|
||||
src/read_data.c
|
||||
src/snprintf.c
|
||||
)
|
||||
|
||||
add_library(libmatio ${SRC})
|
||||
target_include_directories(libmatio PRIVATE src visual_studio)
|
||||
target_compile_definitions(libmatio PRIVATE
|
||||
-DH5_NO_DEPRECATED_SYMBOLS
|
||||
-DMAT73=1
|
||||
-DREPLACE_GETOPT
|
||||
-DMATIO_HAVE_INTTYPES_H=1
|
||||
-DMATIO_HAVE_STDINT_H=1
|
||||
)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(libmatio PRIVATE ZLIB::ZLIB)
|
||||
target_compile_definitions(libmatio PRIVATE -DHAVE_ZLIB=1)
|
||||
|
||||
find_package(HDF5 REQUIRED)
|
||||
target_include_directories(libmatio PRIVATE ${HDF5_INCLUDE_DIRS} )
|
||||
target_link_libraries(libmatio PRIVATE ${HDF5_C_LIBRARIES})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(libmatio PRIVATE -DHAVE_HDF5=1 -DH5_BUILT_AS_DYNAMIC_LIB)
|
||||
else()
|
||||
target_compile_definitions(libmatio PRIVATE -DHAVE_HDF5=1 -DH5_BUILT_AS_STATIC_LIB)
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS libmatio
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(FILES
|
||||
src/matio.h
|
||||
visual_studio/matio_pubconf.h
|
||||
DESTINATION include
|
||||
)
|
||||
endif()
|
4
ports/matio/CONTROL
Normal file
4
ports/matio/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: matio
|
||||
Version: 1.5.10-1
|
||||
Description: MATLAB MAT File I/O Library
|
||||
Build-Depends: zlib, hdf5
|
23
ports/matio/portfile.cmake
Normal file
23
ports/matio/portfile.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO tbeu/matio
|
||||
REF v1.5.10
|
||||
SHA512 c06ff6b3d17a136be20cebca4e1a4bb87eea98e35d979713e73f855487dee568895245528b1b8e55caf02f88aff1b742daf75f590e2d3b08158d0ad73e377243
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/matio RENAME copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
Loading…
Reference in New Issue
Block a user