aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Jaspe <ajaspe@gmail.com>2020-09-01 10:36:35 +0200
committerGitHub <noreply@github.com>2020-09-01 01:36:35 -0700
commitea82e4650890001b6a3177781e0c6096c9e1ca54 (patch)
treef109039c5c0689331e8ffb92f093ea832654547c
parenta0536798eeb0786a4a27078c1b797ab7b6c41dd1 (diff)
downloadvcpkg-ea82e4650890001b6a3177781e0c6096c9e1ca54.tar.gz
vcpkg-ea82e4650890001b6a3177781e0c6096c9e1ca54.zip
[levmar] Add new port (#13164)
Co-authored-by: LilyWangL <wangli28@beyondsoft.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
-rw-r--r--ports/levmar/add-install.patch11
-rw-r--r--ports/levmar/portfile.cmake33
-rw-r--r--ports/levmar/vcpkg.json7
3 files changed, 51 insertions, 0 deletions
diff --git a/ports/levmar/add-install.patch b/ports/levmar/add-install.patch
new file mode 100644
index 000000000..d256c77ad
--- /dev/null
+++ b/ports/levmar/add-install.patch
@@ -0,0 +1,11 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cc6789f..d2757f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -95,3 +95,6 @@ IF(BUILD_DEMO)
+ ENDIF(BUILD_DEMO)
+
+ #SUBDIRS(matlab)
++
++install(TARGETS levmar LIBRARY DESTINATION "lib/")
++install(FILES "${CMAKE_SOURCE_DIR}/levmar.h" DESTINATION "include/levmar/")
diff --git a/ports/levmar/portfile.cmake b/ports/levmar/portfile.cmake
new file mode 100644
index 000000000..020d42520
--- /dev/null
+++ b/ports/levmar/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_fail_port_install(MESSAGE "levmar currently only checked on Windows"
+ ON_TARGET "OSX" "Linux" "UWP"
+)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://users.ics.forth.gr/~lourakis/levmar/levmar-2.6.tgz"
+ FILENAME "levmar-2.6.tgz"
+ SHA512 5b4c64b63be9b29d6ad2df435af86cd2c2e3216313378561a670ac6a392a51bbf1951e96c6b1afb77c570f23dd8e194017808e46929fec2d8d9a7fe6cf37022b
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES add-install.patch # patch just adding the install commands to original CMakeLists.txt
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DHAVE_LAPACK=OFF
+ -DHAVE_PLASMA=OFF
+ -DBUILD_DEMO=OFF
+)
+
+vcpkg_install_cmake()
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+
+# Handle duplicated debug includes
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
diff --git a/ports/levmar/vcpkg.json b/ports/levmar/vcpkg.json
new file mode 100644
index 000000000..99c22de73
--- /dev/null
+++ b/ports/levmar/vcpkg.json
@@ -0,0 +1,7 @@
+{
+ "name": "levmar",
+ "version-string": "2.6",
+ "description": "Levenberg-Marquardt nonlinear least squares optimization algorithm",
+ "homepage": "http://users.ics.forth.gr/~lourakis/levmar/",
+ "supports": "!(uwp | osx | linux)"
+}