2020-02-29 13:56:22 +08:00
vcpkg_fail_port_install ( ON_TARGET "UWP" ON_ARCH "x86" )
2017-10-26 02:51:21 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h" )
2020-05-16 07:37:54 +08:00
message ( FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible." )
2017-10-26 02:51:21 +08:00
endif ( )
2020-05-16 07:37:54 +08:00
if ( VCPKG_TARGET_IS_LINUX )
message ( WARNING "${PORT} needs ncurses on LINUX, please install ncurses first.\nOn Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel." )
2019-06-12 05:41:02 +08:00
endif ( )
2018-03-03 04:28:34 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m y s q l / m y s q l - s e r v e r
2020-05-16 07:37:54 +08:00
R E F 7 d 1 0 c 8 2 1 9 6 c 8 e 4 5 5 5 4 f 2 7 c 0 0 6 8 1 4 7 4 a 9 f b 8 6 d 1 3 7 # 8.0.20
S H A 5 1 2 9 f 5 e 8 c c 2 5 4 e a 2 a 4 c f 7 6 3 1 3 2 8 7 c 7 b b 6 f c 6 9 3 4 0 0 8 1 0 4 6 4 d d 2 9 0 1 e 6 7 d 5 1 e c b 2 7 f 8 9 1 6 0 0 9 4 6 4 f d 8 a e d 8 3 6 5 c 3 0 3 8 3 1 4 b 8 4 5 b 3 d 5 1 7 d b 6 e 8 2 a e 5 c 7 9 0 8 6 1 2 f 0 b 3 b 7 2 3 3 5 f
2018-03-03 04:28:34 +08:00
H E A D _ R E F m a s t e r
2018-03-20 01:30:33 +08:00
P A T C H E S
2019-06-12 05:41:02 +08:00
i g n o r e - b o o s t - v e r s i o n . p a t c h
s y s t e m - l i b s . p a t c h
2020-05-14 01:26:05 +08:00
r e n a m e - v e r s i o n . p a t c h
2017-10-26 02:51:21 +08:00
)
2020-05-16 07:37:54 +08:00
file ( REMOVE_RECURSE ${ SOURCE_PATH } /include/boost_1_70_0 )
2018-03-13 23:14:58 +08:00
2018-03-08 03:10:12 +08:00
set ( STACK_DIRECTION )
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
set ( STACK_DIRECTION -DSTACK_DIRECTION=-1 )
endif ( )
2020-05-16 07:37:54 +08:00
#Skip the version check for Visual Studio
if ( VCPKG_TARGET_IS_WINDOWS )
set ( FORCE_UNSUPPORTED_COMPILER 1 )
endif ( )
2017-10-26 02:51:21 +08:00
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2018-03-13 23:14:58 +08:00
P R E F E R _ N I N J A
2017-10-26 02:51:21 +08:00
O P T I O N S
- D W I T H O U T _ S E R V E R = O N
- D W I T H _ U N I T _ T E S T S = O F F
- D E N A B L E D _ P R O F I L I N G = O F F
- D W I X _ D I R = O F F
2018-03-08 03:10:12 +08:00
$ { S T A C K _ D I R E C T I O N }
2018-03-13 23:14:58 +08:00
- D I G N O R E _ B O O S T _ V E R S I O N = O N
2018-03-20 01:30:33 +08:00
- D W I T H _ S S L = s y s t e m
- D W I T H _ I C U = s y s t e m
- D W I T H _ L I B E V E N T = s y s t e m
- D W I T H _ L Z 4 = s y s t e m
- D W I T H _ Z L I B = s y s t e m
2020-05-16 07:37:54 +08:00
- D F O R C E _ U N S U P P O R T E D _ C O M P I L E R = $ { F O R C E _ U N S U P P O R T E D _ C O M P I L E R }
2017-10-26 02:51:21 +08:00
)
2018-03-20 01:30:33 +08:00
vcpkg_install_cmake ( ADD_BIN_TO_PATH )
2017-10-26 02:51:21 +08:00
# delete debug headers
file ( REMOVE_RECURSE
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e )
# switch mysql into /mysql
file ( RENAME ${ CURRENT_PACKAGES_DIR } /include ${ CURRENT_PACKAGES_DIR } /include2 )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /include )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /include2 ${ CURRENT_PACKAGES_DIR } /include/mysql )
## delete useless vcruntime/scripts/bin/msg file
file ( REMOVE_RECURSE
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e
$ { C U R R E N T _ P A C K A G E S _ D I R } / b i n
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n
$ { C U R R E N T _ P A C K A G E S _ D I R } / d o c s
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / d o c s
2020-02-29 13:56:22 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / d e b u g
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / p l u g i n / d e b u g )
2017-10-26 02:51:21 +08:00
2020-05-16 07:37:54 +08:00
## remove misc files
2017-10-26 02:51:21 +08:00
file ( REMOVE
2018-03-13 23:14:58 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / L I C E N S E
2017-10-26 02:51:21 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / R E A D M E
2018-03-13 23:14:58 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / L I C E N S E
2017-10-26 02:51:21 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / R E A D M E )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
file ( REMOVE
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / l i b m y s q l . l i b
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / l i b m y s q l . d l l
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / l i b m y s q l . p d b
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / l i b m y s q l . l i b
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / l i b m y s q l . d l l
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / l i b m y s q l . p d b )
else ( )
file ( REMOVE
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / m y s q l c l i e n t . l i b
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / m y s q l c l i e n t . l i b )
2019-06-12 05:41:02 +08:00
# correct the dll directory
2018-10-04 14:09:42 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /bin )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/libmysql.dll ${ CURRENT_PACKAGES_DIR } /bin/libmysql.dll )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/libmysql.pdb ${ CURRENT_PACKAGES_DIR } /bin/libmysql.pdb )
endif ( )
2019-06-12 05:41:02 +08:00
2018-10-04 14:09:42 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /debug/bin )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/lib/libmysql.dll ${ CURRENT_PACKAGES_DIR } /debug/bin/libmysql.dll )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/lib/libmysql.pdb ${ CURRENT_PACKAGES_DIR } /debug/bin/libmysql.pdb )
endif ( )
2017-10-26 02:51:21 +08:00
endif ( )
2018-03-20 04:17:59 +08:00
file ( READ ${ CURRENT_PACKAGES_DIR } /include/mysql/mysql_com.h _contents )
string ( REPLACE "#include <mysql/udf_registration_types.h>" "#include \" mysql/udf_registration_types.h\ "" _contents "${_contents}" )
file ( WRITE ${ CURRENT_PACKAGES_DIR } /include/mysql/mysql_com.h "${_contents}" )
2017-10-26 02:51:21 +08:00
# copy license
2020-02-29 13:56:22 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )