aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/quantlib
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/quantlib')
-rw-r--r--vcpkg/ports/quantlib/portfile.cmake37
-rw-r--r--vcpkg/ports/quantlib/usage4
-rw-r--r--vcpkg/ports/quantlib/vcpkg.json43
3 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/quantlib/portfile.cmake b/vcpkg/ports/quantlib/portfile.cmake
new file mode 100644
index 0000000..34d9b08
--- /dev/null
+++ b/vcpkg/ports/quantlib/portfile.cmake
@@ -0,0 +1,37 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lballabio/QuantLib
+ REF "v${VERSION}"
+ SHA512 6cc9102069644a8d333fed962a02e4fed1771a0b5c110fa7fcf538ce51a109b3ed2c2ace24fb20b67d13aa1feb2e9290a3e0549e8c67e7806a9fbd886c85f357
+ HEAD_REF master
+)
+
+if (VCPKG_TARGET_IS_WINDOWS)
+ # This can (and should) be removed if QuantLib ever supports dynamically linking on Windows
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DQL_BUILD_EXAMPLES=OFF
+ -DQL_BUILD_TEST_SUITE=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME QuantLib CONFIG_PATH lib/cmake/QuantLib)
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+# Remove the "bin" directories if we are building static libraries
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+# Install custom usage
+configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/quantlib/usage b/vcpkg/ports/quantlib/usage
new file mode 100644
index 0000000..e121873
--- /dev/null
+++ b/vcpkg/ports/quantlib/usage
@@ -0,0 +1,4 @@
+The package quantlib provides CMake targets:
+
+ find_package(QuantLib CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE QuantLib::QuantLib)
diff --git a/vcpkg/ports/quantlib/vcpkg.json b/vcpkg/ports/quantlib/vcpkg.json
new file mode 100644
index 0000000..c11c7dc
--- /dev/null
+++ b/vcpkg/ports/quantlib/vcpkg.json
@@ -0,0 +1,43 @@
+{
+ "name": "quantlib",
+ "version": "1.40",
+ "description": "The QuantLib C++ library",
+ "homepage": "https://www.quantlib.org/",
+ "license": "BSD-3-Clause",
+ "supports": "!(windows & !static)",
+ "dependencies": [
+ "boost-accumulators",
+ "boost-algorithm",
+ "boost-any",
+ "boost-assert",
+ "boost-bimap",
+ "boost-bind",
+ "boost-config",
+ "boost-core",
+ "boost-date-time",
+ "boost-dynamic-bitset",
+ "boost-format",
+ "boost-function",
+ "boost-functional",
+ "boost-iterator",
+ "boost-math",
+ "boost-multi-array",
+ "boost-multiprecision",
+ "boost-optional",
+ "boost-preprocessor",
+ "boost-smart-ptr",
+ "boost-tuple",
+ "boost-type-traits",
+ "boost-ublas",
+ "boost-unordered",
+ "boost-utility",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}