aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xtensor
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/xtensor')
-rw-r--r--vcpkg/ports/xtensor/fix-find-tbb-and-install-destination.patch33
-rw-r--r--vcpkg/ports/xtensor/fix-find-xsimd.patch31
-rw-r--r--vcpkg/ports/xtensor/portfile.cmake40
-rw-r--r--vcpkg/ports/xtensor/vcpkg.json33
4 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/xtensor/fix-find-tbb-and-install-destination.patch b/vcpkg/ports/xtensor/fix-find-tbb-and-install-destination.patch
new file mode 100644
index 0000000..24e40bb
--- /dev/null
+++ b/vcpkg/ports/xtensor/fix-find-tbb-and-install-destination.patch
@@ -0,0 +1,33 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c7ec920..6f46641 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -75,8 +75,8 @@ if(XTENSOR_USE_XSIMD)
+ endif()
+
+ if(XTENSOR_USE_TBB)
+- set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
+- find_package(TBB REQUIRED)
++ #set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
++ find_package(TBB CONFIG REQUIRED)
+ message(STATUS "Found intel TBB: ${TBB_INCLUDE_DIRS}")
+ endif()
+
+@@ -260,7 +260,7 @@ export(EXPORT ${PROJECT_NAME}-targets
+ install(DIRECTORY ${XTENSOR_INCLUDE_DIR}/xtensor
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+-set(XTENSOR_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE
++set(XTENSOR_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
+ STRING "install path for xtensorConfig.cmake")
+
+ configure_package_config_file(${PROJECT_NAME}Config.cmake.in
+@@ -287,7 +287,7 @@ configure_file(${PROJECT_NAME}.pc.in
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
+ @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
+- DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig/")
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
+
+ # Write single include
+ # ====================
diff --git a/vcpkg/ports/xtensor/fix-find-xsimd.patch b/vcpkg/ports/xtensor/fix-find-xsimd.patch
new file mode 100644
index 0000000..ff8d38b
--- /dev/null
+++ b/vcpkg/ports/xtensor/fix-find-xsimd.patch
@@ -0,0 +1,31 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5c93655..f02dc48 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -69,7 +69,12 @@ if(XTENSOR_USE_XSIMD)
+ message(STATUS "Found xsimd v${xsimd_VERSION}")
+ endif()
+ else()
+- find_package(xsimd ${xsimd_REQUIRED_VERSION} REQUIRED)
++ find_package(xsimd CONFIG REQUIRED)
++ if(${xsimd_VERSION} GREATER_EQUAL ${xsimd_REQUIRED_VERSION})
++ set(xsimd_REQUIRED_VERSION ${xsimd_VERSION})
++ else()
++ message(ERROR "Mismatch xsimd versions. Found '${xsimd_VERSION}' but requires: '${xsimd_REQUIRED_VERSION}'")
++ endif()
+ message(STATUS "Found xsimd: ${xsimd_INCLUDE_DIRS}/xsimd")
+ endif()
+ endif()
+diff --git a/xtensorConfig.cmake.in b/xtensorConfig.cmake.in
+index ec72abb..7825612 100644
+--- a/xtensorConfig.cmake.in
++++ b/xtensorConfig.cmake.in
+@@ -25,7 +25,7 @@ if(NOT TARGET @PROJECT_NAME@)
+ endif()
+
+ if(XTENSOR_USE_XSIMD)
+- find_dependency(xsimd @xsimd_REQUIRED_VERSION@)
++ find_dependency(xsimd @xsimd_REQUIRED_VERSION@ CONFIG)
+ target_link_libraries(@PROJECT_NAME@ INTERFACE xsimd)
+ target_compile_definitions(@PROJECT_NAME@ INTERFACE XTENSOR_USE_XSIMD)
+ endif()
diff --git a/vcpkg/ports/xtensor/portfile.cmake b/vcpkg/ports/xtensor/portfile.cmake
new file mode 100644
index 0000000..9217d65
--- /dev/null
+++ b/vcpkg/ports/xtensor/portfile.cmake
@@ -0,0 +1,40 @@
+# header-only library
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xtensor-stack/xtensor
+ REF "${VERSION}"
+ SHA512 52616a61f9c74c9a37daea5615edb210ff9ef636620266c04ef3e145a067ed685c36febdee4d225ff7c4865e45384e92034a0e7bf9d255727aca7100bc45143c
+ HEAD_REF master
+ PATCHES
+ fix-find-tbb-and-install-destination.patch
+ fix-find-xsimd.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ xsimd XTENSOR_USE_XSIMD
+ tbb XTENSOR_USE_TBB
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -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
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/xtensor/vcpkg.json b/vcpkg/ports/xtensor/vcpkg.json
new file mode 100644
index 0000000..61b1e1f
--- /dev/null
+++ b/vcpkg/ports/xtensor/vcpkg.json
@@ -0,0 +1,33 @@
+{
+ "name": "xtensor",
+ "version": "0.27.0",
+ "description": "C++ tensors with broadcasting and lazy computing",
+ "homepage": "https://github.com/xtensor-stack/xtensor",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ "nlohmann-json",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "xtl"
+ ],
+ "features": {
+ "tbb": {
+ "description": "xtensor with tbb support",
+ "dependencies": [
+ "tbb"
+ ]
+ },
+ "xsimd": {
+ "description": "xtensor with xsimd support",
+ "dependencies": [
+ "xsimd"
+ ]
+ }
+ }
+}