mirror of https://github.com/microsoft/vcpkg.git
[libmatio-cpp] Add new port to vcpkg (#44589)
Co-authored-by: Alberto Luaces <alberto.luaces@udc.es> Co-authored-by: Kai Pastor <dg0yt@darc.de> Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This commit is contained in:
parent
ab26d2e400
commit
acd5bba5aa
|
|
@ -0,0 +1,85 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2e61060..02c714f 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -91,7 +91,8 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
|
||||
## Dependencies
|
||||
-find_package(MATIO REQUIRED)
|
||||
+find_package(PkgConfig REQUIRED)
|
||||
+pkg_check_modules(matio REQUIRED IMPORTED_TARGET matio)
|
||||
find_package(Eigen3 QUIET)
|
||||
|
||||
if (Eigen3_FOUND)
|
||||
@@ -100,10 +101,10 @@ endif()
|
||||
|
||||
# Fetching visit_struct
|
||||
include(CMakeDependentOption)
|
||||
-find_package(visit_struct QUIET)
|
||||
-option(USE_SYSTEM_visit_struct "Use system visit_struct" ${visit_struct_FOUND})
|
||||
+find_package(unofficial-visit_struct QUIET)
|
||||
+option(USE_SYSTEM_visit_struct "Use system visit_struct" ${unofficial-visit_struct_FOUND})
|
||||
if(USE_SYSTEM_visit_struct)
|
||||
- find_package(visit_struct REQUIRED)
|
||||
+ find_package(unofficial-visit_struct REQUIRED)
|
||||
else()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(visit_struct
|
||||
@@ -182,8 +183,14 @@ target_include_directories(matioCpp PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SO
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/Autogenerated>"
|
||||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
|
||||
|
||||
-target_link_libraries(matioCpp PUBLIC MATIO::MATIO visit_struct::visit_struct)
|
||||
-list(APPEND MATIOCPP_DEPENDENCIES MATIO visit_struct)
|
||||
+
|
||||
+target_link_libraries(matioCpp PUBLIC unofficial::visit_struct::visit_struct)
|
||||
+# Avoid propagating pkg-config dependencies down the line.
|
||||
+get_target_property(matio_LINK_LIBRARIES PkgConfig::matio INTERFACE_LINK_LIBRARIES)
|
||||
+target_include_directories(matioCpp PUBLIC ${matio_INCLUDE_DIRS})
|
||||
+target_link_libraries(matioCpp PUBLIC ${matio_LINK_LIBRARIES})
|
||||
+
|
||||
+list(APPEND MATIOCPP_DEPENDENCIES PkgConfig::matio unofficial-visit_struct)
|
||||
|
||||
if (Eigen3_FOUND)
|
||||
target_link_libraries(matioCpp PUBLIC Eigen3::Eigen)
|
||||
@@ -208,7 +215,7 @@ add_library(matioCpp::matioCpp ALIAS matioCpp)
|
||||
|
||||
# Specify installation targets, typology and destination folders.
|
||||
install(TARGETS matioCpp
|
||||
- EXPORT matioCppTargets
|
||||
+ EXPORT matioCppTargets DESTINATION share/matioCpp
|
||||
COMPONENT runtime
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib
|
||||
@@ -216,22 +223,15 @@ install(TARGETS matioCpp
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/matioCpp/" COMPONENT dev
|
||||
PRIVATE_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/matioCpp/impl" COMPONENT dev)
|
||||
|
||||
-install(FILES "cmake/FindMATIO.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/matioCpp/cmake")
|
||||
-file(COPY "cmake/FindMATIO.cmake" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/share/matioCpp/cmake")
|
||||
-
|
||||
-install(FILES "cmake/Findvisit_struct.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/matioCpp/cmake")
|
||||
-file(COPY "cmake/Findvisit_struct.cmake" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/share/matioCpp/cmake")
|
||||
-
|
||||
-include(InstallBasicPackageFiles)
|
||||
+include(CMakePackageConfigHelpers)
|
||||
+configure_package_config_file(matioCppConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/matioCppConfig.cmake
|
||||
+ INSTALL_DESTINATION share/matioCpp
|
||||
+)
|
||||
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/matioCppConfig.cmake" DESTINATION share/matioCpp)
|
||||
+install(EXPORT matioCppTargets
|
||||
+ NAMESPACE matioCpp::
|
||||
+ DESTINATION share/matioCpp)
|
||||
|
||||
-install_basic_package_files(${PROJECT_NAME}
|
||||
- VERSION ${${PROJECT_NAME}_VERSION}
|
||||
- EXPORT matioCppTargets
|
||||
- COMPATIBILITY AnyNewerVersion
|
||||
- VARS_PREFIX ${PROJECT_NAME}
|
||||
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
- DEPENDENCIES ${MATIOCPP_DEPENDENCIES}
|
||||
- OVERRIDE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/matioCpp/cmake)
|
||||
# Add the uninstall target
|
||||
include(AddUninstallTarget)
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# matio already included with targets
|
||||
find_dependency(unofficial-visit_struct)
|
||||
find_dependency(Eigen3)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/matioCppTargets.cmake")
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO ami-iit/matio-cpp
|
||||
REF "v${VERSION}"
|
||||
SHA512 efae9cec18b44291625f0770dabe8fd23c5b1d7cf77849cab827880ca96328430d4146014ace82d443bbc00cc313fd23cd5d67a7f1b58235efa7b5cb291a8ea4
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-dependencies.patch
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/matioCppConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME matioCpp)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
libmatio-cpp provides CMake targets:
|
||||
|
||||
find_package(matioCpp REQUIRED)
|
||||
target_link_libraries(yourTarget PRIVATE matioCpp::matioCpp)
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "libmatio-cpp",
|
||||
"version": "0.3.0",
|
||||
"description": "matio-cpp is a C++ wrapper for the matio library, automatically dealing with memory allocation and deallocation. It can be used for reading and writing binary MATLAB .mat files from C++, without the need to access or rely on MATLAB's own shared libraries.",
|
||||
"homepage": "https://github.com/ami-iit/matio-cpp",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": [
|
||||
"eigen3",
|
||||
"matio",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"visit-struct"
|
||||
]
|
||||
}
|
||||
|
|
@ -4860,6 +4860,10 @@
|
|||
"baseline": "3.4.1",
|
||||
"port-version": 0
|
||||
},
|
||||
"libmatio-cpp": {
|
||||
"baseline": "0.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"libmaxminddb": {
|
||||
"baseline": "1.12.2",
|
||||
"port-version": 0
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "0b87e1164133373ca1f29a25fd1793f04e19fb72",
|
||||
"version": "0.3.0",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue