2018-03-14 18:18:12 +08:00
|
|
|
if (EXISTS "${CURRENT_INSTALLED_DIR}/share/libmysql")
|
|
|
|
message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.")
|
2017-01-25 10:25:38 +08:00
|
|
|
endif()
|
|
|
|
|
2018-03-14 18:18:12 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO MariaDB/mariadb-connector-c
|
2020-10-21 02:01:40 +08:00
|
|
|
REF 159540fe8c8f30b281748fe8a1b79e8b17993a67 # v3.1.10
|
|
|
|
SHA512 3e154f5dc4b5051607c7ebc0691a50c0699d60e4414660cf8f65689081ff78ef6b135667761ba8ac4163b469a3b55158c6b48c6fc0a0cc09381452aad157e4ad
|
|
|
|
HEAD_REF 3.1
|
2019-05-24 12:44:54 +08:00
|
|
|
PATCHES
|
2020-10-16 03:32:58 +08:00
|
|
|
md.patch
|
|
|
|
disable-test-build.patch
|
|
|
|
fix-InstallPath.patch
|
2020-10-21 02:01:40 +08:00
|
|
|
fix-iconv.patch
|
2020-11-11 01:28:45 +08:00
|
|
|
export-cmake-targets.patch
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
2020-08-06 05:03:22 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
zlib WITH_EXTERNAL_ZLIB
|
2020-10-21 02:01:40 +08:00
|
|
|
iconv WITH_ICONV
|
2020-08-06 05:03:22 +08:00
|
|
|
)
|
|
|
|
|
2020-10-27 12:00:50 +08:00
|
|
|
if("openssl" IN_LIST FEATURES)
|
|
|
|
set(WITH_SSL OPENSSL)
|
|
|
|
else()
|
|
|
|
set(WITH_SSL OFF)
|
|
|
|
endif()
|
|
|
|
|
2017-01-20 17:06:11 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-08-01 04:01:02 +08:00
|
|
|
PREFER_NINJA
|
2018-03-14 18:18:12 +08:00
|
|
|
OPTIONS
|
2020-08-06 05:03:22 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2018-03-14 18:18:12 +08:00
|
|
|
-DWITH_UNITTEST=OFF
|
|
|
|
-DWITH_CURL=OFF
|
2020-10-27 12:00:50 +08:00
|
|
|
-DWITH_SSL=${WITH_SSL}
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2020-11-11 01:28:45 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-libmariadb TARGET_PATH share/unofficial-libmariadb)
|
|
|
|
|
2018-10-13 06:12:15 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
# remove debug header
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
endif()
|
|
|
|
|
2019-08-16 11:20:25 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
2018-10-13 06:12:15 +08:00
|
|
|
if(VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
# move headers
|
|
|
|
file(RENAME
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
endif()
|
2017-01-20 17:06:11 +08:00
|
|
|
|
|
|
|
# remove plugin folder
|
|
|
|
file(REMOVE_RECURSE
|
2018-03-14 18:18:12 +08:00
|
|
|
${CURRENT_PACKAGES_DIR}/lib/mariadb
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/mariadb)
|
2017-01-20 17:06:11 +08:00
|
|
|
|
|
|
|
# copy & remove header files
|
|
|
|
file(REMOVE
|
2018-03-14 18:18:12 +08:00
|
|
|
${CURRENT_PACKAGES_DIR}/include/mariadb/my_config.h.in
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/mariadb/mysql_version.h.in
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/mariadb/CMakeLists.txt
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/mariadb/Makefile.am)
|
2017-01-25 10:25:38 +08:00
|
|
|
file(RENAME
|
2018-03-14 18:18:12 +08:00
|
|
|
${CURRENT_PACKAGES_DIR}/include/mariadb
|
|
|
|
${CURRENT_PACKAGES_DIR}/include/mysql)
|
2017-01-20 17:06:11 +08:00
|
|
|
|
2020-10-21 02:01:40 +08:00
|
|
|
# copy license file
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|