vcpkg/ports/onednn/portfile.cmake

27 lines
913 B
CMake
Raw Normal View History

2020-12-17 16:12:26 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO oneapi-src/oneDNN
2022-07-21 06:43:00 +08:00
REF 58be3660fb57c4c4a3d306730e849237d1271572 #2.6.1
SHA512 8fc51655d0ecdb5b137d04c6b3ee01959d9505e0d7ee74cab872447b5873f214d38db55edf4040a56d4455557ec2c0707097337c6e276dbaf1c9c6e48b95a820
2020-12-17 16:12:26 +08:00
HEAD_REF master
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(DNNL_OPTIONS "-DDNNL_LIBRARY_TYPE=STATIC")
2020-12-17 16:12:26 +08:00
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2020-12-17 16:12:26 +08:00
OPTIONS ${DNNL_OPTIONS}
)
vcpkg_cmake_install()
2020-12-17 16:12:26 +08:00
# The port name and the find_package() name are different (onednn versus dnnl)
vcpkg_cmake_config_fixup(PACKAGE_NAME dnnl CONFIG_PATH lib/cmake/dnnl)
2020-12-17 16:12:26 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Copyright and license
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)