2020-01-22 04:29:39 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
|
2018-08-29 04:42:46 +08:00
|
|
|
|
2023-04-05 06:48:29 +08:00
|
|
|
set(MA_VERSION 1008)
|
2018-02-24 15:04:58 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-02-11 03:11:51 +08:00
|
|
|
URLS "https://monkeysaudio.com/files/MAC_${MA_VERSION}_SDK.zip"
|
|
|
|
FILENAME "MAC_${MA_VERSION}_SDK.zip"
|
2023-04-05 06:48:29 +08:00
|
|
|
SHA512 0c96b6fa8da9d412679e8c9b43e98d475a650899694a9d085c3b0272775cf229bb09c7c4f24a18ab7ee5516d2d34f7acd59e4216aca8fe08ed04f75e33e29322
|
2018-02-24 15:04:58 +08:00
|
|
|
)
|
|
|
|
|
2023-01-05 04:09:10 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
2019-10-08 01:35:13 +08:00
|
|
|
NO_REMOVE_ONE_LEVEL
|
2020-12-31 02:38:48 +08:00
|
|
|
PATCHES
|
|
|
|
remove-certificate-step.patch
|
2019-10-08 01:35:13 +08:00
|
|
|
)
|
2018-02-24 15:04:58 +08:00
|
|
|
|
2020-01-22 04:29:39 +08:00
|
|
|
file(REMOVE_RECURSE
|
2023-01-05 04:09:10 +08:00
|
|
|
"${SOURCE_PATH}/Shared/32"
|
|
|
|
"${SOURCE_PATH}/Shared/64"
|
2018-08-29 04:42:46 +08:00
|
|
|
)
|
2018-02-26 00:09:17 +08:00
|
|
|
|
2020-01-22 04:29:39 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
set(PLATFORM Win32)
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
|
|
|
set(PLATFORM x64)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unsupported architecture")
|
|
|
|
endif()
|
|
|
|
|
2023-02-25 03:57:40 +08:00
|
|
|
# Use /Z7 rather than /Zi to avoid "fatal error C1090: PDB API call failed, error code '23': (0x00000006)"
|
|
|
|
foreach(VCXPROJ IN ITEMS
|
|
|
|
"${SOURCE_PATH}/Source/Projects/VS2022/Console/Console.vcxproj"
|
|
|
|
"${SOURCE_PATH}/Source/Projects/VS2022/DirectShow Filter/APE Decoder.vcxproj"
|
|
|
|
"${SOURCE_PATH}/Source/Projects/VS2022/MAC/MAC.vcxproj"
|
|
|
|
"${SOURCE_PATH}/Source/Projects/VS2022/MACDll/MACDll.vcxproj"
|
|
|
|
"${SOURCE_PATH}/Source/Projects/VS2022/MACLib/MACLib.vcxproj")
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>"
|
|
|
|
"<DebugInformationFormat>OldStyle</DebugInformationFormat>"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"<DebugInformationFormat>EditAndContinue</DebugInformationFormat>"
|
|
|
|
"<DebugInformationFormat>OldStyle</DebugInformationFormat>"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
2020-01-22 04:29:39 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
vcpkg_install_msbuild(
|
2023-01-05 04:09:10 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-02-22 01:05:50 +08:00
|
|
|
PROJECT_SUBPATH "Source/Projects/VS2022/MACDll/MACDll.vcxproj"
|
2020-01-22 04:29:39 +08:00
|
|
|
PLATFORM ${PLATFORM}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_install_msbuild(
|
2023-01-05 04:09:10 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-02-22 01:05:50 +08:00
|
|
|
PROJECT_SUBPATH "Source/Projects/VS2022/MACLib/MACLib.vcxproj"
|
2020-01-22 04:29:39 +08:00
|
|
|
PLATFORM ${PLATFORM}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if ("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_install_msbuild(
|
2023-01-05 04:09:10 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-02-22 01:05:50 +08:00
|
|
|
PROJECT_SUBPATH "Source/Projects/VS2022/Console/Console.vcxproj"
|
2020-01-22 04:29:39 +08:00
|
|
|
PLATFORM ${PLATFORM}
|
|
|
|
)
|
2020-12-31 02:38:48 +08:00
|
|
|
|
2023-01-05 04:09:10 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/Console.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/Console.lib")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/monkeys-audio/Console.exe" "${CURRENT_PACKAGES_DIR}/tools/monkeys-audio/mac.exe")
|
2020-01-22 04:29:39 +08:00
|
|
|
endif()
|
2023-02-22 01:05:50 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/MACDll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/lib/MACDll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/MACDll64.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/lib/MACDll64.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
|
|
|
endif()
|
2020-01-22 04:29:39 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2023-02-22 01:05:50 +08:00
|
|
|
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib" "${CURRENT_PACKAGES_DIR}/lib")
|
2020-01-22 04:29:39 +08:00
|
|
|
endif()
|
2018-02-24 15:04:58 +08:00
|
|
|
|
2023-02-22 01:05:50 +08:00
|
|
|
|
2023-01-05 04:09:10 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
file(COPY "${SOURCE_PATH}/Shared/"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/include/monkeys-audio"
|
2018-02-24 15:04:58 +08:00
|
|
|
FILES_MATCHING PATTERN "*.h")
|
|
|
|
|
2023-01-05 04:09:10 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${CMAKE_CURRENT_LIST_DIR}/license")
|