diff options
| author | James Chang <twmr7@outlook.com> | 2017-11-01 16:27:12 +0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-11-01 01:27:12 -0700 |
| commit | 4ff90ec4309df1d5937d62c52683e1147066445a (patch) | |
| tree | ed046f2c9db0716f9cb9ff292111c9a46f92ef6b | |
| parent | 516c42bdc4a5443e0f78fae559c187823e6326d1 (diff) | |
| download | vcpkg-4ff90ec4309df1d5937d62c52683e1147066445a.tar.gz vcpkg-4ff90ec4309df1d5937d62c52683e1147066445a.zip | |
[poco] build with MySQL support (#2088)
* [poco] build with MySQL support
Set proper variables to enable MySQL support if libmysql port is installed
* [poco] Move Mysql support to a feature. Enable CMake config files.
| -rw-r--r-- | ports/poco/CONTROL | 6 | ||||
| -rw-r--r-- | ports/poco/portfile.cmake | 19 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 3 |
3 files changed, 21 insertions, 7 deletions
diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 2c78b6c6e..4eb60a07d 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,8 @@ Source: poco -Version: 1.7.8-1 +Version: 1.7.8-2 Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. + +Feature: mysql +Build-Depends: libmysql +Description: Mysql support for POCO diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 3ef0af921..315eaf2e5 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -16,10 +16,13 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(POCO_STATIC ON) -else() - set(POCO_STATIC OFF) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC) + +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") endif() vcpkg_configure_cmake( @@ -30,6 +33,11 @@ vcpkg_configure_cmake( -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... + -DMYSQL_INCLUDE_DIR=${MYSQL_INCLUDE_DIR} + OPTIONS_RELEASE + -DMYSQL_LIB=${MYSQL_LIB} + OPTIONS_DEBUG + -DMYSQL_LIB=${MYSQL_LIB_DEBUG} ) vcpkg_install_cmake() @@ -53,8 +61,7 @@ else() endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/poco) # copy license file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 069672b71..ca228b2a4 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -116,6 +116,9 @@ function(vcpkg_fixup_cmake_targets) "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" _contents "${_contents}") + string(REPLACE "${CURRENT_INSTALLED_DIR}" "_INVALID_ROOT_" _contents "${_contents}") + string(REGEX REPLACE ";_INVALID_ROOT_/[^\";]*" "" _contents "${_contents}") + string(REGEX REPLACE "_INVALID_ROOT_/[^\";]*;" "" _contents "${_contents}") file(WRITE ${MAIN_TARGET} "${_contents}") endforeach() |
