aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2019-03-28 22:36:44 +0100
committerPhil Christensen <philc@microsoft.com>2019-03-28 14:36:44 -0700
commitf59ebe91029fa50eff3b1801a13f82e37f95bed2 (patch)
tree8b7889f0fb83358655df44a4ecf4be157dfcedcc /ports
parent3c4411b846536fd470613ba8ad4479f0efae5792 (diff)
downloadvcpkg-f59ebe91029fa50eff3b1801a13f82e37f95bed2.tar.gz
vcpkg-f59ebe91029fa50eff3b1801a13f82e37f95bed2.zip
[libhungarian] add port (#5849)
* [libhungarian] add port * [hungarian] fix cmake targets
Diffstat (limited to 'ports')
-rw-r--r--ports/hungarian/CMakeLists.txt29
-rw-r--r--ports/hungarian/CONTROL3
-rw-r--r--ports/hungarian/LICENSE.txt24
-rw-r--r--ports/hungarian/portfile.cmake31
4 files changed, 87 insertions, 0 deletions
diff --git a/ports/hungarian/CMakeLists.txt b/ports/hungarian/CMakeLists.txt
new file mode 100644
index 000000000..dc0098ca7
--- /dev/null
+++ b/ports/hungarian/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required (VERSION 3.8)
+project (hungarian C)
+
+add_library(hungarian
+ ${CMAKE_CURRENT_LIST_DIR}/libhungarian/hungarian.h
+ ${CMAKE_CURRENT_LIST_DIR}/libhungarian/hungarian.c
+)
+
+target_include_directories(hungarian PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libhungarian>
+ $<INSTALL_INTERFACE:include>
+)
+
+set_target_properties(hungarian PROPERTIES PUBLIC_HEADER ${CMAKE_CURRENT_LIST_DIR}/libhungarian/hungarian.h)
+
+install(
+ TARGETS hungarian
+ EXPORT hungarian
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ PUBLIC_HEADER DESTINATION include
+)
+
+install(EXPORT hungarian
+ DESTINATION "share/hungarian"
+ FILE hungarianConfig.cmake
+ NAMESPACE hungarian::
+)
diff --git a/ports/hungarian/CONTROL b/ports/hungarian/CONTROL
new file mode 100644
index 000000000..96dd5f799
--- /dev/null
+++ b/ports/hungarian/CONTROL
@@ -0,0 +1,3 @@
+Source: hungarian
+Version: v0.1.3
+Description: C-implementation of the Hungarian Method: finding the optimal assignment (assigning a set of jobs to a set of machines) in O(n^3), where n=max{#jobs, #machines}. The implementation is a sligntly enhanced version of the implementation provided by the Stanford GraphBase
diff --git a/ports/hungarian/LICENSE.txt b/ports/hungarian/LICENSE.txt
new file mode 100644
index 000000000..9255ea6bf
--- /dev/null
+++ b/ports/hungarian/LICENSE.txt
@@ -0,0 +1,24 @@
+/********************************************************************
+ ********************************************************************
+ **
+ ** libhungarian by Cyrill Stachniss, 2004
+ **
+ **
+ ** Solving the Minimum Assignment Problem using the
+ ** Hungarian Method.
+ **
+ ** ** This file may be freely copied and distributed! **
+ **
+ ** Parts of the used code was originally provided by the
+ ** "Stanford GraphGase", but I made changes to this code.
+ ** As asked by the copyright node of the "Stanford GraphGase",
+ ** I hereby proclaim that this file are *NOT* part of the
+ ** "Stanford GraphGase" distrubition!
+ **
+ ** This file is distributed in the hope that it will be useful,
+ ** but WITHOUT ANY WARRANTY; without even the implied
+ ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ ** PURPOSE.
+ **
+ ********************************************************************
+ ********************************************************************/
diff --git a/ports/hungarian/portfile.cmake b/ports/hungarian/portfile.cmake
new file mode 100644
index 000000000..0d550756e
--- /dev/null
+++ b/ports/hungarian/portfile.cmake
@@ -0,0 +1,31 @@
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://www2.informatik.uni-freiburg.de/~stachnis/misc/libhungarian-v0.1.3.tgz"
+ FILENAME "libhungarian-v0.1.3.tgz"
+ SHA512 1fa105e351c307c07bb96892c9d4c44b167d92cbed80962a8653ac35b8afe00fcf5dcc2d920b95671d6c3cd86745362a64dd8dc173623a8179006e2c7b2cbc69
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ NO_REMOVE_ONE_LEVEL
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/hungarian RENAME copyright)