aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xtl
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/xtl')
-rw-r--r--vcpkg/ports/xtl/fix-fixup-cmake.patch49
-rw-r--r--vcpkg/ports/xtl/portfile.cmake27
-rw-r--r--vcpkg/ports/xtl/vcpkg.json18
3 files changed, 94 insertions, 0 deletions
diff --git a/vcpkg/ports/xtl/fix-fixup-cmake.patch b/vcpkg/ports/xtl/fix-fixup-cmake.patch
new file mode 100644
index 0000000..655273c
--- /dev/null
+++ b/vcpkg/ports/xtl/fix-fixup-cmake.patch
@@ -0,0 +1,49 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 796dc46..d2be91f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -30,7 +30,7 @@ message(STATUS "xtl v${${PROJECT_NAME}_VERSION}")
+ # ============
+
+ if(NOT TARGET nlohmann_json)
+- find_package(nlohmann_json QUIET)
++ find_package(nlohmann_json QUIET REQUIRED)
+ endif()
+
+ # Build
+@@ -80,6 +80,7 @@ set_target_properties(xtl
+ PUBLIC_HEADER "${XTL_HEADERS}")
+
+ target_compile_features(xtl INTERFACE cxx_std_17)
++target_link_libraries(xtl INTERFACE nlohmann_json::nlohmann_json)
+
+ option(BUILD_TESTS "xtl test suite" OFF)
+ option(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)
+@@ -104,7 +105,7 @@ install(TARGETS xtl
+ export(EXPORT ${PROJECT_NAME}-targets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
+
+-set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}" CACHE
++set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
+ STRING "install path for xtlConfig.cmake")
+
+ configure_package_config_file(${PROJECT_NAME}Config.cmake.in
+@@ -133,4 +134,4 @@ 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_DATAROOTDIR}/pkgconfig/")
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
+diff --git a/xtlConfig.cmake.in b/xtlConfig.cmake.in
+index 936eef1..ef392c6 100644
+--- a/xtlConfig.cmake.in
++++ b/xtlConfig.cmake.in
+@@ -13,6 +13,8 @@
+ # xtl_INCLUDE_DIRS - the directory containing xtl headers
+ # xtl_LIBRARY - empty
+
++include(CMakeFindDependencyMacro)
++find_dependency(nlohmann_json)
+ @PACKAGE_INIT@
+
+ if(NOT TARGET @PROJECT_NAME@)
diff --git a/vcpkg/ports/xtl/portfile.cmake b/vcpkg/ports/xtl/portfile.cmake
new file mode 100644
index 0000000..4d14d0d
--- /dev/null
+++ b/vcpkg/ports/xtl/portfile.cmake
@@ -0,0 +1,27 @@
+# header-only library
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xtensor-stack/xtl
+ REF "${VERSION}"
+ SHA512 534d7e3779a8b95371994bed16ddab00083e3a068244354d59aabd4576b7e0678c92064e0a93bba94ed3195410e3b8aefdec9e8c53d70c7d9e83d318377f522a
+ HEAD_REF master
+ PATCHES
+ fix-fixup-cmake.patch
+)
+
+set(VCPKG_BUILD_TYPE release)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTS=OFF
+ -DDOWNLOAD_GTEST=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/xtl)
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/xtl/vcpkg.json b/vcpkg/ports/xtl/vcpkg.json
new file mode 100644
index 0000000..ff48d7a
--- /dev/null
+++ b/vcpkg/ports/xtl/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "xtl",
+ "version": "0.8.0",
+ "description": "The x template library",
+ "homepage": "https://github.com/xtensor-stack/xtl",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ "nlohmann-json",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}