aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2020-09-09 21:10:56 +0200
committerGitHub <noreply@github.com>2020-09-09 12:10:56 -0700
commitaa042ad0fb35c01ebd27dc3655e11c7dd8df689b (patch)
tree70cbbb9cde654c9feeeef44f9681365661b2c22b
parent468e82de6e0cfcdb5588e58d1322c07bcdffd9e6 (diff)
downloadvcpkg-aa042ad0fb35c01ebd27dc3655e11c7dd8df689b.tar.gz
vcpkg-aa042ad0fb35c01ebd27dc3655e11c7dd8df689b.zip
[mp-units] add new port (#13416)
* [mp-units] add new port * fix config
-rw-r--r--ports/mp-units/CONTROL5
-rw-r--r--ports/mp-units/cmake.patch35
-rw-r--r--ports/mp-units/config.patch9
-rw-r--r--ports/mp-units/portfile.cmake24
4 files changed, 73 insertions, 0 deletions
diff --git a/ports/mp-units/CONTROL b/ports/mp-units/CONTROL
new file mode 100644
index 000000000..355d1cf45
--- /dev/null
+++ b/ports/mp-units/CONTROL
@@ -0,0 +1,5 @@
+Source: mp-units
+Version: 0.6.0
+Homepage: https://github.com/mpusz/units
+Description: mp-units - A Units Library for C++
+Build-Depends: fmt, ms-gsl
diff --git a/ports/mp-units/cmake.patch b/ports/mp-units/cmake.patch
new file mode 100644
index 000000000..d5a57ce8b
--- /dev/null
+++ b/ports/mp-units/cmake.patch
@@ -0,0 +1,35 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b18a30a96..d89248aa1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -40,14 +40,24 @@ conan_init(cmake)
+ add_subdirectory(src)
+
+ # set restrictive compilation warnings
+-set_warnings(mp-units)
++# set_warnings(mp-units)
+
+ # add unit tests
+-enable_testing()
+-add_subdirectory(test)
++option(BUILD_TESTING "Build tests" OFF)
++if(BUILD_TESTING)
++ set_warnings(mp-units)
++ enable_testing()
++ add_subdirectory(test)
++endif()
+
+ # add usage example
+-add_subdirectory(example)
+-
++option(BUILD_EXAMPLES "Build usage examples" OFF)
++if(BUILD_EXAMPLES)
++ add_subdirectory(example)
++endif()
+ # generate project documentation
+-add_subdirectory(docs)
++
++option(BUILD_DOCS "Generate docs" OFF)
++if(BUILD_DOCS)
++ add_subdirectory(docs)
++endif()
diff --git a/ports/mp-units/config.patch b/ports/mp-units/config.patch
new file mode 100644
index 000000000..5bd81c927
--- /dev/null
+++ b/ports/mp-units/config.patch
@@ -0,0 +1,9 @@
+diff --git a/cmake/common/simple-config.cmake.in b/cmake/common/simple-config.cmake.in
+index f40ebfa88..d521e0ba8 100644
+--- a/cmake/common/simple-config.cmake.in
++++ b/cmake/common/simple-config.cmake.in
+@@ -1 +1,4 @@
++include(CMakeFindDependencyMacro)
++find_dependency(fmt CONFIG)
++find_dependency(Microsoft.GSL CONFIG)
+ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
diff --git a/ports/mp-units/portfile.cmake b/ports/mp-units/portfile.cmake
new file mode 100644
index 000000000..1200c1719
--- /dev/null
+++ b/ports/mp-units/portfile.cmake
@@ -0,0 +1,24 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO mpusz/units
+ REF 33ad51311b835efb7f7767473f971c02a3140073
+ SHA512 18c9a4bb1812d7ab59e86d3eef5f62aa760c8f78eac81086bd3b25f7e2d359f2fba71b0298cf91ecb31dbe13846f2e5ce75133b0db534020102b788dd1c1a1da
+ PATCHES
+ cmake.patch
+ config.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
+# Handle copyright/readme/package files
+file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+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 \ No newline at end of file