mirror of https://github.com/microsoft/vcpkg.git
[libmysofa] Revise dependencies (#51246)
This commit is contained in:
parent
e6926402d7
commit
d7fa0d990c
|
|
@ -0,0 +1,47 @@
|
|||
diff --git a/libmysofa.pc.cmake b/libmysofa.pc.cmake
|
||||
index 3c597fa..b09b0b7 100644
|
||||
--- a/libmysofa.pc.cmake
|
||||
+++ b/libmysofa.pc.cmake
|
||||
@@ -8,4 +8,4 @@ Libs: -L${libdir} -lmysofa
|
||||
Cflags: -I${includedir}
|
||||
|
||||
Libs.private: @PKG_CONFIG_PRIVATELIBS@
|
||||
-#Requires.private:
|
||||
+Requires.private: zlib
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index cc800b3..29e9b5d 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -4,23 +4,19 @@ configure_file(config.h.in config.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(NOT MSVC)
|
||||
- if(NOT WIN32)
|
||||
- find_library(MATH m)
|
||||
- else()
|
||||
- set(MATH "")
|
||||
- endif()
|
||||
- include(FindZLIB)
|
||||
+ find_library(HAVE_MATH m PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+endif()
|
||||
+if(HAVE_MATH)
|
||||
+ set(MATH m)
|
||||
+ string(APPEND PKG_CONFIG_PRIVATELIBS " -lm")
|
||||
else()
|
||||
set(MATH "")
|
||||
- find_program(NUGET nuget)
|
||||
- if(NUGET)
|
||||
- execute_process(COMMAND ${NUGET} install zlib)
|
||||
- endif()
|
||||
- include_directories(
|
||||
- ${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/)
|
||||
endif()
|
||||
+find_package(ZLIB REQUIRED)
|
||||
+set(ZLIB_LIBRARIES ZLIB::ZLIB)
|
||||
|
||||
-if(NOT MSVC)
|
||||
+if(1)
|
||||
+elseif(0) # redundant
|
||||
if(NOT WIN32)
|
||||
find_library(MATH m)
|
||||
else()
|
||||
|
|
@ -1,36 +1,35 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO hoene/libmysofa
|
||||
REF "v${VERSION}"
|
||||
SHA512 58bd056678503491292a8a9b6b3f43451995a2c0a16735e4ae474d2d3e49bd7b3d6ef3dbfd0ce78e30d9f70887dd9cac60a8fae05ece0c167414f8ac4d3d5514
|
||||
HEAD_REF main
|
||||
PATCHES
|
||||
use-vcpkg-zlib.patch
|
||||
)
|
||||
|
||||
# default.sofa is a symlink to MIT_KEMAR_normal_pinna.sofa,
|
||||
# which can cause problems e.g. on Windows file systems.
|
||||
if(EXISTS "${SOURCE_PATH}/share/default.sofa")
|
||||
file(REMOVE "${SOURCE_PATH}/share/default.sofa")
|
||||
endif()
|
||||
file(COPY_FILE "${SOURCE_PATH}/share/MIT_KEMAR_normal_pinna.sofa" "${SOURCE_PATH}/share/default.sofa")
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME mysofa CONFIG_PATH lib/cmake/mysofa)
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO hoene/libmysofa
|
||||
REF "v${VERSION}"
|
||||
SHA512 58bd056678503491292a8a9b6b3f43451995a2c0a16735e4ae474d2d3e49bd7b3d6ef3dbfd0ce78e30d9f70887dd9cac60a8fae05ece0c167414f8ac4d3d5514
|
||||
HEAD_REF main
|
||||
PATCHES
|
||||
dependencies.diff
|
||||
)
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/windows/third-party")
|
||||
|
||||
# default.sofa is a symlink to MIT_KEMAR_normal_pinna.sofa,
|
||||
# which can cause problems e.g. on Windows file systems.
|
||||
file(REMOVE "${SOURCE_PATH}/share/default.sofa")
|
||||
file(COPY_FILE "${SOURCE_PATH}/share/MIT_KEMAR_normal_pinna.sofa" "${SOURCE_PATH}/share/default.sofa")
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME mysofa CONFIG_PATH lib/cmake/mysofa)
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
libmysofa provides CMake targets:
|
||||
|
||||
find_package(mysofa CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:mysofa::mysofa-shared>,mysofa::mysofa-shared,mysofa::mysofa-static>)
|
||||
libmysofa provides CMake targets:
|
||||
|
||||
find_package(mysofa CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:mysofa::mysofa-shared>,mysofa::mysofa-shared,mysofa::mysofa-static>)
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 018f4ce..90ec50d 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -13,21 +13,25 @@ use_c99()
|
||||
configure_file(config.h.in config.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
+find_package(ZLIB REQUIRED)
|
||||
+
|
||||
if(NOT MSVC)
|
||||
if(NOT WIN32)
|
||||
find_library(MATH m)
|
||||
else()
|
||||
set(MATH "")
|
||||
endif()
|
||||
- include(FindZLIB)
|
||||
+ #include(FindZLIB)
|
||||
else()
|
||||
set(MATH "")
|
||||
+ #[[
|
||||
find_program(NUGET nuget)
|
||||
if(NUGET)
|
||||
execute_process(COMMAND ${NUGET} install zlib)
|
||||
endif()
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/)
|
||||
+ ]]#
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
@@ -36,12 +40,13 @@ if(NOT MSVC)
|
||||
else()
|
||||
set(MATH "")
|
||||
endif()
|
||||
- include(FindZLIB)
|
||||
- include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
+ #include(FindZLIB)
|
||||
+ #include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
set(PKG_CONFIG_PRIVATELIBS "-lm ${PKG_CONFIG_PRIVATELIBS}")
|
||||
set(PKG_CONFIG_PRIVATELIBS "-lz ${PKG_CONFIG_PRIVATELIBS}")
|
||||
else()
|
||||
set(MATH "")
|
||||
+ #[[
|
||||
find_program(NUGET nuget)
|
||||
if(NOT NUGET)
|
||||
message(
|
||||
@@ -53,6 +58,7 @@ else()
|
||||
endif()
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/)
|
||||
+ ]]#
|
||||
endif()
|
||||
|
||||
set(libsrc
|
||||
@@ -81,6 +87,8 @@ set(public-headers
|
||||
hrtf/mysofa.h
|
||||
)
|
||||
|
||||
+install(FILES "${public-headers}" DESTINATION include)
|
||||
+
|
||||
if(BUILD_STATIC_LIBS)
|
||||
add_library(mysofa-static STATIC ${libsrc})
|
||||
target_include_directories(mysofa-static
|
||||
@@ -88,7 +96,7 @@ target_include_directories(mysofa-static
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
|
||||
$<INSTALL_INTERFACE:include/>
|
||||
)
|
||||
-target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ${ZLIB_LIBRARIES})
|
||||
+target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ZLIB::ZLIB)
|
||||
set_target_properties(
|
||||
mysofa-static
|
||||
PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE
|
||||
@@ -120,7 +128,7 @@ if(BUILD_SHARED_LIBS)
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
|
||||
$<INSTALL_INTERFACE:include/>
|
||||
)
|
||||
- target_link_libraries(mysofa-shared PRIVATE ${MATH} ${ZLIB_LIBRARIES})
|
||||
+ target_link_libraries(mysofa-shared PRIVATE ${MATH} ZLIB::ZLIB)
|
||||
set_target_properties(mysofa-shared
|
||||
PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
|
||||
# Rename the Windows import library (stub) of the DLL to prevent a name clash
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "libmysofa",
|
||||
"version": "1.3.4",
|
||||
"port-version": 1,
|
||||
"description": "Reader for AES SOFA files to get better HRTFs (Head-Relative Transfer Functions)",
|
||||
"homepage": "https://github.com/hoene/libmysofa",
|
||||
"license": "BSD-3-Clause",
|
||||
|
|
|
|||
|
|
@ -347,7 +347,6 @@ libmikmod:arm-neon-android=fail
|
|||
libmikmod:arm64-android=fail
|
||||
libmikmod:x64-android=fail
|
||||
libmodman:x64-windows-static=fail
|
||||
libmysofa:arm64-linux=fail
|
||||
libmysql:x86-windows=skip
|
||||
libnick:arm64-linux=fail
|
||||
libnick:arm64-osx=fail # missing system-installed copy of sqlcipher
|
||||
|
|
|
|||
|
|
@ -638,7 +638,6 @@ libmikmod:arm64-linux=cascade
|
|||
libmodman:x64-windows-static=fail
|
||||
libmtp:arm64-linux=cascade
|
||||
libmultisense[opencv]:arm64-linux=cascade
|
||||
libmysofa:arm64-linux=fail
|
||||
libnick:arm64-linux=fail
|
||||
libnick:arm64-osx=fail
|
||||
libnick:x64-linux=fail
|
||||
|
|
|
|||
|
|
@ -5306,7 +5306,7 @@
|
|||
},
|
||||
"libmysofa": {
|
||||
"baseline": "1.3.4",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"libmysql": {
|
||||
"baseline": "8.0.40",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "cea6a1df1f1abdabbe88ded1d501b0b4825ca812",
|
||||
"version": "1.3.4",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "0e80ab6bc6a75bb1b2ff6d3cd339ae0e82f148c0",
|
||||
"version": "1.3.4",
|
||||
|
|
|
|||
Loading…
Reference in New Issue