aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-09-10 01:51:56 +0800
committerVictor Romero <romerosanchezv@gmail.com>2019-09-09 10:51:56 -0700
commitfb9c83a3bab367f4d30d0395f820ecd11d544283 (patch)
tree51fd1cd485712c94113f2ab7480f9d59a6ab366e
parent188d5e1c19ec017f215ecfb3c7395a6771b19148 (diff)
downloadvcpkg-fb9c83a3bab367f4d30d0395f820ecd11d544283.tar.gz
vcpkg-fb9c83a3bab367f4d30d0395f820ecd11d544283.zip
[quantlib] Add new port (#7283)
* [quantlib] Add new port * [quantlib] Fix x64-windows-static build * [quantlib] Use unique_ptr by default
-rw-r--r--ports/quantlib/CONTROL5
-rw-r--r--ports/quantlib/disable-examples-tests.patch13
-rw-r--r--ports/quantlib/portfile.cmake41
3 files changed, 59 insertions, 0 deletions
diff --git a/ports/quantlib/CONTROL b/ports/quantlib/CONTROL
new file mode 100644
index 000000000..50c006335
--- /dev/null
+++ b/ports/quantlib/CONTROL
@@ -0,0 +1,5 @@
+Source: quantlib
+Version: 2019-09-02
+Description: The QuantLib C++ library
+Homepage: https://www.quantlib.org/
+Build-Depends: boost-accumulators, boost-algorithm, boost-any, boost-array, boost-assert, boost-assign, boost-atomic, boost-bind, boost-config, boost-core, boost-date-time, boost-dynamic-bitset, boost-format, boost-function, boost-functional, boost-iterator, boost-lexical-cast, boost-math, boost-multi-array, boost-multiprecision, boost-optional, boost-preprocessor, boost-random, boost-serialization, boost-signals2, boost-smart-ptr, boost-thread, boost-tuple, boost-type-traits, boost-ublas, boost-unordered, boost-utility
diff --git a/ports/quantlib/disable-examples-tests.patch b/ports/quantlib/disable-examples-tests.patch
new file mode 100644
index 000000000..b42e0bc25
--- /dev/null
+++ b/ports/quantlib/disable-examples-tests.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d046251cc..d8201bf6a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -44,8 +44,6 @@ if (Boost_FOUND)
+ endif (Boost_FOUND)
+
+ add_subdirectory(ql)
+-add_subdirectory(Examples)
+-add_subdirectory(test-suite)
+
+ #
+ # Copy across the ANSI config file into the build directory. Users
diff --git a/ports/quantlib/portfile.cmake b/ports/quantlib/portfile.cmake
new file mode 100644
index 000000000..7894bbba7
--- /dev/null
+++ b/ports/quantlib/portfile.cmake
@@ -0,0 +1,41 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lballabio/QuantLib
+ REF f09141b5cce9134c0bcdbaf36e81359e6ba30705
+ SHA512 d4b19d33594a7072a0d90b7eac3d74fb27c526269713a9223b84c0451b1e06a58f0c98350305d68a55086d1971260ff249049112aaadea59397ec195a3291490
+ HEAD_REF master
+ PATCHES
+ disable-examples-tests.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" USE_BOOST_DYNAMIC_LIBRARIES)
+
+set(QL_MSVC_RUNTIME ${VCPKG_LIBRARY_LINKAGE})
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+# TODO: Fix it in the upstream
+vcpkg_replace_string(
+ "${SOURCE_PATH}/ql/userconfig.hpp"
+ "//# define QL_USE_STD_UNIQUE_PTR"
+ "# define QL_USE_STD_UNIQUE_PTR"
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DUSE_BOOST_DYNAMIC_LIBRARIES=${USE_BOOST_DYNAMIC_LIBRARIES}
+ -DMSVC_RUNTIME=${QL_MSVC_RUNTIME}
+)
+
+vcpkg_install_cmake()
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)