2017-01-25 10:25:38 +08:00
|
|
|
|
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()
|
|
|
|
|
2017-01-20 17:06:11 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2018-03-14 18:18:12 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO MariaDB/mariadb-connector-c
|
2020-02-11 08:08:57 +08:00
|
|
|
REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7
|
|
|
|
SHA512 b663effe7794d997c0589a9a20dab6b7359414612e60e3cb43e3fd0ddeae0391bcbc2d816cba4a7438602566ad6781cbf8e18b0062f1d37a2b2bd521af16033c
|
2018-03-14 18:18:12 +08:00
|
|
|
HEAD_REF master
|
2019-05-24 12:44:54 +08:00
|
|
|
PATCHES
|
|
|
|
md.patch
|
|
|
|
disable-test-build.patch
|
2019-07-25 01:23:29 +08:00
|
|
|
fix-InstallPath.patch
|
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
|
|
|
|
-DWITH_UNITTEST=OFF
|
|
|
|
-DWITH_SSL=OFF
|
|
|
|
-DWITH_CURL=OFF
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
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
|
|
|
|
|
|
|
# copy license file
|
|
|
|
file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright)
|