2016-10-13 19:07:01 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2018-11-03 07:17:07 +08:00
|
|
|
# Only static libraries are supported.
|
|
|
|
# See https://github.com/nanodbc/nanodbc/issues/13
|
|
|
|
if(VCPKG_USE_HEAD_VERSION) # v2.13
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
else() # v2.12.4
|
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nanodbc/nanodbc
|
|
|
|
REF v2.12.4
|
2016-10-13 19:07:01 +08:00
|
|
|
SHA512 b9a924516b2a777e5f1497774997672320548722ed53413b0a7ad5d503e2f8ca1099f5059a912b7aae410928f4c4edcdfd02e4cfbf415976cd222697b354b4e6
|
2018-11-03 07:17:07 +08:00
|
|
|
HEAD_REF master
|
2016-10-13 19:07:01 +08:00
|
|
|
)
|
|
|
|
|
2018-11-03 07:17:07 +08:00
|
|
|
# Legacy, remove at release of v2.13
|
|
|
|
if(NOT VCPKG_USE_HEAD_VERSION)
|
2016-10-13 19:07:01 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2016-11-09 06:25:47 +08:00
|
|
|
PATCHES
|
2016-10-13 19:07:01 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/0002_msvc14_codecvt.patch
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/0003_export_def.patch
|
2016-10-14 11:21:32 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/0004_unicode.patch
|
2016-10-13 19:07:01 +08:00
|
|
|
)
|
2018-11-03 07:17:07 +08:00
|
|
|
endif()
|
|
|
|
# /Legacy
|
2016-10-13 19:07:01 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-11-03 07:17:07 +08:00
|
|
|
OPTIONS
|
|
|
|
# Legacy, remove at release of v2.13
|
2016-10-13 19:07:01 +08:00
|
|
|
-DNANODBC_EXAMPLES=OFF
|
|
|
|
-DNANODBC_TEST=OFF
|
2016-10-14 02:34:02 +08:00
|
|
|
-DNANODBC_USE_UNICODE=ON
|
2018-11-03 07:17:07 +08:00
|
|
|
# /Legacy
|
|
|
|
-DNANODBC_DISABLE_EXAMPLES=ON
|
|
|
|
-DNANODBC_DISABLE_TESTS=ON
|
|
|
|
-DNANODBC_ENABLE_UNICODE=ON
|
2016-10-13 19:07:01 +08:00
|
|
|
)
|
|
|
|
|
2016-11-09 06:25:47 +08:00
|
|
|
vcpkg_install_cmake()
|
2016-10-13 19:07:01 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2018-11-03 07:17:07 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
|
|
|
|
endif()
|
2016-10-13 19:07:01 +08:00
|
|
|
|
2018-11-03 07:17:07 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/nanodbc RENAME copyright)
|