aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-01-27 08:44:25 +0800
committerCodiferous <44823842+Codiferous@users.noreply.github.com>2019-01-26 16:44:25 -0800
commit01a64a9371adeab3b3a2f297ed3639fc8e0c65b2 (patch)
tree5a39c608e4ab05e2ac55b5a6c09909c08363dad6
parent54abff84a1d7e2d37f46d4a61141de6734d60a1f (diff)
downloadvcpkg-01a64a9371adeab3b3a2f297ed3639fc8e0c65b2.tar.gz
vcpkg-01a64a9371adeab3b3a2f297ed3639fc8e0c65b2.zip
[xtensor] Add new port (#5196)
-rw-r--r--ports/xtensor/CONTROL12
-rw-r--r--ports/xtensor/portfile.cmake51
2 files changed, 63 insertions, 0 deletions
diff --git a/ports/xtensor/CONTROL b/ports/xtensor/CONTROL
new file mode 100644
index 000000000..01614cba0
--- /dev/null
+++ b/ports/xtensor/CONTROL
@@ -0,0 +1,12 @@
+Source: xtensor
+Version: 2019-01-20
+Description: C++ tensors with broadcasting and lazy computing
+Build-Depends: nlohmann-json, xtl
+
+Feature: xsimd
+Description: xtensor with xsimd support
+Build-Depends: xsimd
+
+Feature: tbb
+Description: xtensor with tbb support
+Build-Depends: tbb
diff --git a/ports/xtensor/portfile.cmake b/ports/xtensor/portfile.cmake
new file mode 100644
index 000000000..795bb3ce8
--- /dev/null
+++ b/ports/xtensor/portfile.cmake
@@ -0,0 +1,51 @@
+# header-only library
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO QuantStack/xtensor
+ REF ca0cfdbde852ee61a3ef20076e2733030f3d6479
+ SHA512 d960a3c1c3e6c9250c6bc5ed4e641486980a3ffa4179696eabb92fee50673901324cd2174b76cbd74ab07e6f3c175a26cb564b3087863602c3dce0a83a263da6
+ HEAD_REF master
+)
+
+if("xsimd" IN_LIST FEATURES)
+ set(XTENSOR_USE_XSIMD ON)
+else()
+ set(XTENSOR_USE_XSIMD OFF)
+endif()
+
+if("tbb" IN_LIST FEATURES)
+ set(XTENSOR_USE_TBB ON)
+else()
+ set(XTENSOR_USE_TBB OFF)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DXTENSOR_USE_XSIMD=${XTENSOR_USE_XSIMD}
+ -DXTENSOR_USE_TBB=${XTENSOR_USE_TBB}
+ -DXTENSOR_ENABLE_ASSERT=OFF
+ -DXTENSOR_CHECK_DIMENSION=OFF
+ -DBUILD_TESTS=OFF
+ -DBUILD_BENCHMARK=OFF
+ -DDOWNLOAD_GTEST=OFF
+ -DDOWNLOAD_GBENCHMARK=OFF
+ -DDEFAULT_COLUMN_MAJOR=OFF
+ -DDISABLE_VS2017=OFF
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
+
+# CMake integration test
+vcpkg_test_cmake(PACKAGE_NAME ${PORT})