vcpkg/ports/libflac/portfile.cmake

49 lines
1.9 KiB
CMake
Raw Normal View History

2016-12-06 19:14:31 +08:00
include(vcpkg_common_functions)
2017-02-25 22:25:20 +08:00
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flac-1.3.2)
2016-12-06 19:14:31 +08:00
vcpkg_download_distfile(ARCHIVE
2017-02-25 22:25:20 +08:00
URLS "http://downloads.xiph.org/releases/flac/flac-1.3.2.tar.xz"
FILENAME "flac-1.3.2.tar.xz"
SHA512 63910e8ebbe508316d446ffc9eb6d02efbd5f47d29d2ea7864da9371843c8e671854db6e89ba043fe08aef1845b8ece70db80f1cce853f591ca30d56ef7c3a15)
2016-12-07 06:39:17 +08:00
2016-12-06 19:14:31 +08:00
vcpkg_extract_source_archive(${ARCHIVE})
2017-11-17 07:54:14 +08:00
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flac-1.3.2
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/uwp-consolewidth.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-loadlibrary.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-createfile.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-writeconsole.patch"
)
endif()
2017-03-10 06:52:45 +08:00
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
endif()
2016-12-06 19:14:31 +08:00
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2017-02-25 22:25:20 +08:00
PREFER_NINJA
OPTIONS
-DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}
OPTIONS_DEBUG
-DLIBFLAC_SKIP_HEADERS=ON)
2016-12-06 19:14:31 +08:00
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n")
2017-02-25 22:25:20 +08:00
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLACPP_API\n#define FLACPP_API\n")
endif()
2016-12-06 19:14:31 +08:00
# This license (BSD) is relevant only for library - if someone would want to install
# FLAC cmd line tools as well additional license (GPL) should be included
file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright)