2016-11-16 15:10:40 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-11-30 05:12:11 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO pocoproject/poco
|
2018-05-02 07:34:16 +08:00
|
|
|
REF poco-1.9.0-release
|
|
|
|
SHA512 de2346d62b2e89ba04abe62a83f6ede7a496e80bcbe53a880a1aa8e87a8ebd9a430dd70fdc6aada836bb1021c6df21375fd0cbcf62dbb6e29a2f65d6d90cf2b9
|
2017-11-30 05:12:11 +08:00
|
|
|
HEAD_REF master
|
2016-11-16 15:10:40 +08:00
|
|
|
PATCHES
|
2018-09-05 09:21:12 +08:00
|
|
|
config_h.patch
|
|
|
|
find_pcre.patch
|
|
|
|
foundation-public-include-pcre.patch
|
|
|
|
fix-static-internal-pcre.patch
|
2016-11-16 15:10:40 +08:00
|
|
|
)
|
|
|
|
|
2017-11-01 16:27:12 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC)
|
2018-05-01 06:53:00 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT)
|
2017-11-01 16:27:12 +08:00
|
|
|
|
|
|
|
if("mysql" IN_LIST FEATURES)
|
|
|
|
# enabling MySQL support
|
|
|
|
set(MYSQL_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include/mysql")
|
|
|
|
set(MYSQL_LIB "${CURRENT_INSTALLED_DIR}/lib/libmysql.lib")
|
|
|
|
set(MYSQL_LIB_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib/libmysql.lib")
|
2016-11-17 16:35:33 +08:00
|
|
|
endif()
|
|
|
|
|
2016-11-16 15:10:40 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-03-05 19:52:49 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DPOCO_STATIC=${POCO_STATIC}
|
2018-05-01 06:53:00 +08:00
|
|
|
-DPOCO_MT=${POCO_MT}
|
2017-03-05 19:52:49 +08:00
|
|
|
-DENABLE_SEVENZIP=ON
|
|
|
|
-DENABLE_TESTS=OFF
|
|
|
|
-DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ...
|
2017-11-01 16:27:12 +08:00
|
|
|
-DMYSQL_INCLUDE_DIR=${MYSQL_INCLUDE_DIR}
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
-DMYSQL_LIB=${MYSQL_LIB}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DMYSQL_LIB=${MYSQL_LIB_DEBUG}
|
2016-11-16 15:10:40 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
|
2018-09-05 09:21:12 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/cpspc.exe")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/cpspc.exe ${CURRENT_PACKAGES_DIR}/tools/cpspc.exe)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.exe ${CURRENT_PACKAGES_DIR}/tools/f2cpsp.exe)
|
2018-09-04 21:49:13 +08:00
|
|
|
else()
|
2018-09-05 09:21:12 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/cpspc ${CURRENT_PACKAGES_DIR}/tools/cpspc)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/f2cpsp ${CURRENT_PACKAGES_DIR}/tools/f2cpsp)
|
2018-09-04 21:49:13 +08:00
|
|
|
endif()
|
2016-11-16 15:10:40 +08:00
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2017-03-05 19:52:49 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/bin)
|
2016-11-16 17:40:45 +08:00
|
|
|
else()
|
2017-03-05 19:52:49 +08:00
|
|
|
file(REMOVE
|
|
|
|
${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb
|
|
|
|
${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb)
|
2016-11-16 15:10:40 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2018-09-04 23:04:34 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Poco)
|
2016-11-16 15:10:40 +08:00
|
|
|
|
|
|
|
# copy license
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco)
|
2017-03-05 19:52:49 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright)
|