[quantlib] Add new port (#7283)

* [quantlib] Add new port

* [quantlib] Fix x64-windows-static build

* [quantlib] Use unique_ptr by default
This commit is contained in:
myd7349 2019-09-10 01:51:56 +08:00 committed by Victor Romero
parent 188d5e1c19
commit fb9c83a3ba
3 changed files with 59 additions and 0 deletions

5
ports/quantlib/CONTROL Normal file
View File

@ -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

View File

@ -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

View File

@ -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)