aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/mp-units
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/mp-units')
-rw-r--r--vcpkg/ports/mp-units/config.patch20
-rw-r--r--vcpkg/ports/mp-units/portfile.cmake28
-rw-r--r--vcpkg/ports/mp-units/vcpkg.json20
3 files changed, 68 insertions, 0 deletions
diff --git a/vcpkg/ports/mp-units/config.patch b/vcpkg/ports/mp-units/config.patch
new file mode 100644
index 0000000..736b5a7
--- /dev/null
+++ b/vcpkg/ports/mp-units/config.patch
@@ -0,0 +1,20 @@
+diff --git a/src/mp-unitsConfig.cmake b/src/mp-unitsConfig.cmake
+index f5bee933d..5effb72bf 100644
+--- a/src/mp-unitsConfig.cmake
++++ b/src/mp-unitsConfig.cmake
+@@ -23,13 +23,9 @@
+ include(CMakeFindDependencyMacro)
+
+ if(NOT MP_UNITS_API_FREESTANDING AND NOT MP_UNITS_API_STD_FORMAT)
+- find_dependency(fmt)
++ find_dependency(fmt CONFIG)
+ endif()
+
+-if(MP_UNITS_API_CONTRACTS STREQUAL "GSL-LITE")
+- find_dependency(gsl-lite)
+-elseif(MP_UNITS_API_CONTRACTS STREQUAL "MS-GSL")
+- find_dependency(Microsoft.GSL)
+-endif()
++find_dependency(gsl-lite CONFIG)
+
+ include("${CMAKE_CURRENT_LIST_DIR}/mp-unitsTargets.cmake")
diff --git a/vcpkg/ports/mp-units/portfile.cmake b/vcpkg/ports/mp-units/portfile.cmake
new file mode 100644
index 0000000..0b12063
--- /dev/null
+++ b/vcpkg/ports/mp-units/portfile.cmake
@@ -0,0 +1,28 @@
+if(VCPKG_TARGET_IS_LINUX)
+ message("Note: `mp-units` requires Clang16+ or GCC11+")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO mpusz/mp-units
+ REF "v${VERSION}"
+ SHA512 7e3a897a0df438d43dc860febe813f84b671caa26195cea1e8df75769d418d5456852200b8f546107c97214e88e77015e044a95d0c45d4c19341288136e11fbc
+ PATCHES
+ config.patch
+)
+
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/src"
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
+
+# Handle copyright/readme/package files
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
+file(INSTALL "${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug"
+ "${CURRENT_PACKAGES_DIR}/lib") # Header only
diff --git a/vcpkg/ports/mp-units/vcpkg.json b/vcpkg/ports/mp-units/vcpkg.json
new file mode 100644
index 0000000..80e80cb
--- /dev/null
+++ b/vcpkg/ports/mp-units/vcpkg.json
@@ -0,0 +1,20 @@
+{
+ "name": "mp-units",
+ "version": "2.4.0",
+ "port-version": 1,
+ "description": "The quantities and units library for C++",
+ "homepage": "https://mpusz.github.io/mp-units",
+ "license": "MIT",
+ "dependencies": [
+ "fmt",
+ "gsl-lite",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}