From d59fb7942c43c240a5f938b3349fa803b8f4c4b9 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 25 Jul 2017 10:25:17 -0700 Subject: [PATCH 1/4] [libkml] init port --- ports/libkml/CONTROL | 4 ++++ ports/libkml/portfile.cmake | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ports/libkml/CONTROL create mode 100644 ports/libkml/portfile.cmake diff --git a/ports/libkml/CONTROL b/ports/libkml/CONTROL new file mode 100644 index 0000000000..1fe7086af8 --- /dev/null +++ b/ports/libkml/CONTROL @@ -0,0 +1,4 @@ +Source: libkml +Version: 1.3.0 +Description: Reference implementation of OGC KML 2.2 +Build-Depends: zlib, boost, expat, minizip, uriparser diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake new file mode 100644 index 0000000000..9c19ff32bd --- /dev/null +++ b/ports/libkml/portfile.cmake @@ -0,0 +1,17 @@ +include(vcpkg_common_functions) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO libkml/libkml + REF 1.3.0 + SHA512 aa48158103d3af764bf98c1fb4cf3e1356b9cc6c8e79d80b96850916f0a8ccb1dac3a46427735dd0bf20647daa047d10e722ac3da2a214d4c1559bf6d5d7c853 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cxxopts RENAME copyright) + +vcpkg_copy_pdbs() From 148a6e0a5b205e8e83a95d48a996d8d07b50a9cd Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 25 Jul 2017 17:01:55 -0700 Subject: [PATCH 2/4] [libkml] cmake fixup --- ports/libkml/portfile.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index 9c19ff32bd..8aaa969576 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -12,6 +12,8 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cxxopts RENAME copyright) - vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libkml RENAME copyright) From b46bb2f913f553c75af115e7d1106797f491913f Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 28 Jul 2017 16:54:57 -0700 Subject: [PATCH 3/4] [vcpkg] add a patch for empty string literal --- ports/libkml/patch_empty_literal_on_vc.patch | 13 +++++++++++++ ports/libkml/portfile.cmake | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/libkml/patch_empty_literal_on_vc.patch diff --git a/ports/libkml/patch_empty_literal_on_vc.patch b/ports/libkml/patch_empty_literal_on_vc.patch new file mode 100644 index 0000000000..8a3581a05d --- /dev/null +++ b/ports/libkml/patch_empty_literal_on_vc.patch @@ -0,0 +1,13 @@ +diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc +index c46e099..28ccb36 100644 +--- a/src/kml/base/file_win32.cc ++++ b/src/kml/base/file_win32.cc +@@ -42,7 +42,7 @@ namespace kmlbase { + // Internal to the win32 file class. We need a conversion from string to + // LPCWSTR. + static std::wstring Str2Wstr(const string& str) { +- std::wstring wstr(str.length(), L''); ++ std::wstring wstr(str.length(), L' '); + std::copy(str.begin(), str.end(), wstr.begin()); + return wstr; + } diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index 8aaa969576..5d2f014f8a 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -7,6 +7,13 @@ vcpkg_from_github( HEAD_REF master ) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/patch_empty_literal_on_vc.patch" +) + + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} ) From 247497e04d40c5a9a15e22bad32a9e23860f9b4b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 8 Aug 2017 13:50:34 -0700 Subject: [PATCH 4/4] [libkml] Prefer the ninja generator --- ports/libkml/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index 5d2f014f8a..cb07e271f9 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_apply_patches( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA ) vcpkg_install_cmake()