From de9bb1d2027b478fea5686d798022c4d698d9e36 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Wed, 11 Sep 2019 22:11:14 +0200 Subject: [PATCH] [vcl] add vector class library version 2 (#7573) * [vcl] add vector class library version 2 * fix target path * renamed library to vectorclass. Improved CMakelists.txt. Added early architecture failure * don't perform changes in the source dir and make cxx_std_17 a build requirement * update to tagged version 2.00.01 * update version in CMakeLists.txt * refactored CMakeLists.txt --- ports/vectorclass/CMakeLists.txt | 24 ++++++++++++++++++++++++ ports/vectorclass/CONTROL | 4 ++++ ports/vectorclass/portfile.cmake | 24 ++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 ports/vectorclass/CMakeLists.txt create mode 100644 ports/vectorclass/CONTROL create mode 100644 ports/vectorclass/portfile.cmake diff --git a/ports/vectorclass/CMakeLists.txt b/ports/vectorclass/CMakeLists.txt new file mode 100644 index 000000000..54b83b267 --- /dev/null +++ b/ports/vectorclass/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.8.0) +project(vectorclass VERSION 2.00.01 LANGUAGES CXX) + +add_library(${PROJECT_NAME} STATIC instrset_detect.cpp) + +target_include_directories(${PROJECT_NAME} INTERFACE + $ + $) + +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + VERSION ${${PROJECT_NAME}_VERSION} + COMPATIBILITY SameMajorVersion) + +install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-config) +install( + EXPORT ${PROJECT_NAME}-config DESTINATION lib/cmake/${PROJECT_NAME} + NAMESPACE ${PROJECT_NAME}::) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + DESTINATION lib/cmake/${PROJECT_NAME}) +install(DIRECTORY . DESTINATION include/${PROJECT_NAME} FILES_MATCHING PATTERN *.h) \ No newline at end of file diff --git a/ports/vectorclass/CONTROL b/ports/vectorclass/CONTROL new file mode 100644 index 000000000..cc3471358 --- /dev/null +++ b/ports/vectorclass/CONTROL @@ -0,0 +1,4 @@ +Source: vectorclass +Version: 2.00.01 +Homepage: https://github.com/vectorclass/version2 +Description: C++ class library for using the Single Instruction Multiple Data (SIMD) instructions in modern Microprocessors diff --git a/ports/vectorclass/portfile.cmake b/ports/vectorclass/portfile.cmake new file mode 100644 index 000000000..2ec273262 --- /dev/null +++ b/ports/vectorclass/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO vectorclass/version2 + REF v2.00.01 + SHA512 2e1f714cf0e23cf7986f0e78b4c1eeab4da6434ac92449b81990931e19ae189df6fbbef50f11e9532a41dc6eaff0a4fea840349a3747621ff537bbd7519f2c3d + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Put the licence file where vcpkg expects it +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)