Merge pull request #293 from sdcb/poco

Add poco.
This commit is contained in:
Robert Schumacher 2016-11-17 00:31:02 -08:00
commit 8782e7fdf0
5 changed files with 85 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Source: pcre
Version: 8.38
Version: 8.38-1
Description: Perl Compatible Regular Expresions
Build-Depends: zlib

View File

@ -32,6 +32,16 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/include/pcreposix.h)
file(READ ${FILE} PCRE_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(PCRE_STATIC)" "1" PCRE_H "${PCRE_H}")
else()
string(REPLACE "defined(PCRE_STATIC)" "0" PCRE_H "${PCRE_H}")
endif()
file(WRITE ${FILE} "${PCRE_H}")
endforeach()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

4
ports/poco/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: poco
Version: 1.7.6-1
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.

13
ports/poco/config_h.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h
index 003b6dc..55b8eed 100644
--- a/Foundation/include/Poco/Config.h
+++ b/Foundation/include/Poco/Config.h
@@ -31,7 +31,7 @@
// Define to disable implicit linking
-// #define POCO_NO_AUTOMATIC_LIBS
+#define POCO_NO_AUTOMATIC_LIBS
// Define to disable automatic initialization

57
ports/poco/portfile.cmake Normal file
View File

@ -0,0 +1,57 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-poco-1.7.6-release)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/pocoproject/poco/archive/poco-1.7.6-release.tar.gz"
FILENAME "poco-poco-1.7.6-release.tar.gz"
SHA512 a02b7ff66acf080942517b3b8644d6e5c7136c5edc6e58fd13083a74b97b5619253fc9db7863284a565226f95410ad4da1fa9738d14885f560aeb03c1f7c18aa
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/config_h.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DENABLE_SEVENZIP=ON
-DENABLE_TESTS=OFF
-DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ...
)
vcpkg_install_cmake()
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
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)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin)
else()
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)
file(REMOVE
${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll
${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll
${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll
${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll)
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)
# copy license
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright)