aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/tinyxml
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/tinyxml')
-rw-r--r--vcpkg/ports/tinyxml/0001_use_stl.patch27
-rw-r--r--vcpkg/ports/tinyxml/0002_export_tinyxml.patch26
-rw-r--r--vcpkg/ports/tinyxml/CMakeLists.txt40
-rw-r--r--vcpkg/ports/tinyxml/License.txt20
-rw-r--r--vcpkg/ports/tinyxml/portfile.cmake27
-rw-r--r--vcpkg/ports/tinyxml/tinyxml-config.cmake8
-rw-r--r--vcpkg/ports/tinyxml/vcpkg.json17
7 files changed, 165 insertions, 0 deletions
diff --git a/vcpkg/ports/tinyxml/0001_use_stl.patch b/vcpkg/ports/tinyxml/0001_use_stl.patch
new file mode 100644
index 0000000..a36f930
--- /dev/null
+++ b/vcpkg/ports/tinyxml/0001_use_stl.patch
@@ -0,0 +1,27 @@
+From 5ca492fee93015411a0f10e0b2f1d3503bf962a1 Mon Sep 17 00:00:00 2001
+From: Mikhail Paulyshka <me@mixaill.tk>
+Date: Sun, 3 Sep 2017 21:43:36 +0300
+Subject: [PATCH] enforce STL usage
+
+---
+ tinyxml.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tinyxml.h b/tinyxml.h
+index a3589e5..7195033 100644
+--- a/tinyxml.h
++++ b/tinyxml.h
+@@ -43,6 +43,10 @@ distribution.
+ #define DEBUG
+ #endif
+
++#ifndef TIXML_USE_STL
++#define TIXML_USE_STL
++#endif
++
+ #ifdef TIXML_USE_STL
+ #include <string>
+ #include <iostream>
+--
+2.12.2.windows.2
+
diff --git a/vcpkg/ports/tinyxml/0002_export_tinyxml.patch b/vcpkg/ports/tinyxml/0002_export_tinyxml.patch
new file mode 100644
index 0000000..7f09a6e
--- /dev/null
+++ b/vcpkg/ports/tinyxml/0002_export_tinyxml.patch
@@ -0,0 +1,26 @@
+# User Francisco Dias
+# Date 1545049386 7200
+# Mon Dec 17 10:23:06 2018 -0200
+Export tinyXML.
+
+diff --git a/tinyxml.h b/tinyxml.h
+--- a/tinyxml.h
++++ b/tinyxml.h
+@@ -38,6 +38,8 @@
+ #include <string.h>
+ #include <assert.h>
+
++#include "tinyxml_export.h"
++
+ // Help out windows:
+ #if defined( _DEBUG ) && !defined( DEBUG )
+ #define DEBUG
+@@ -414,7 +416,7 @@
+
+ };
+ static Entity entity[ NUM_ENTITY ];
+- static bool condenseWhiteSpace;
++ static TINYXML_EXPORT bool condenseWhiteSpace;
+ };
+
+
diff --git a/vcpkg/ports/tinyxml/CMakeLists.txt b/vcpkg/ports/tinyxml/CMakeLists.txt
new file mode 100644
index 0000000..2004da4
--- /dev/null
+++ b/vcpkg/ports/tinyxml/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 3.4)
+project(tinyxml)
+
+set(HEADERS "tinyxml.h")
+
+set(SOURCES "tinyxml.cpp"
+ "tinyxmlerror.cpp"
+ "tinyxmlparser.cpp"
+)
+
+option(BUILD_SHARED_LIBS "Build shared libs" OFF)
+
+add_library(unofficial-tinyxml ${SOURCES})
+target_compile_definitions(unofficial-tinyxml PRIVATE "-DTIXML_USE_STL")
+set_target_properties(unofficial-tinyxml PROPERTIES OUTPUT_NAME tinyxml)
+
+include(GenerateExportHeader)
+generate_export_header(unofficial-tinyxml BASE_NAME tinyxml)
+
+target_include_directories(unofficial-tinyxml
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ $<INSTALL_INTERFACE:include>
+)
+install(TARGETS unofficial-tinyxml
+ EXPORT tinyxml-export
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+install(EXPORT tinyxml-export
+FILE
+ tinyxmlTargets.cmake
+NAMESPACE
+ unofficial-tinyxml::
+DESTINATION
+ share/tinyxml
+)
+install(FILES ${HEADERS}
+ ${CMAKE_CURRENT_BINARY_DIR}/tinyxml_export.h DESTINATION include)
diff --git a/vcpkg/ports/tinyxml/License.txt b/vcpkg/ports/tinyxml/License.txt
new file mode 100644
index 0000000..2987cf7
--- /dev/null
+++ b/vcpkg/ports/tinyxml/License.txt
@@ -0,0 +1,20 @@
+TinyXML is released under the zlib license:
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution. \ No newline at end of file
diff --git a/vcpkg/ports/tinyxml/portfile.cmake b/vcpkg/ports/tinyxml/portfile.cmake
new file mode 100644
index 0000000..0244618
--- /dev/null
+++ b/vcpkg/ports/tinyxml/portfile.cmake
@@ -0,0 +1,27 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_sourceforge(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO tinyxml/tinyxml
+ REF 2.6.2
+ FILENAME "tinyxml_2_6_2.tar.gz"
+ SHA512 133b5db06131a90ad0c2b39b0063f1c8e65e67288a7e5d67e1f7d9ba32af10dc5dfa0462f9723985ee27debe8f09a10a25d4b5a5aaff2ede979b1cebe8e59d56
+ PATCHES
+ 0001_use_stl.patch
+ 0002_export_tinyxml.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/tinyxml-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
diff --git a/vcpkg/ports/tinyxml/tinyxml-config.cmake b/vcpkg/ports/tinyxml/tinyxml-config.cmake
new file mode 100644
index 0000000..15ad7bd
--- /dev/null
+++ b/vcpkg/ports/tinyxml/tinyxml-config.cmake
@@ -0,0 +1,8 @@
+if (tinyxml_CONFIG_INCLUDED)
+ return()
+endif()
+set(tinyxml_CONFIG_INCLUDED TRUE)
+
+include(${CMAKE_CURRENT_LIST_DIR}/tinyxmlTargets.cmake)
+set(tinyxml_LIBRARIES unofficial-tinyxml::unofficial-tinyxml)
+get_target_property(tinyxml_INCLUDE_DIRS unofficial-tinyxml::unofficial-tinyxml INTERFACE_INCLUDE_DIRECTORIES) \ No newline at end of file
diff --git a/vcpkg/ports/tinyxml/vcpkg.json b/vcpkg/ports/tinyxml/vcpkg.json
new file mode 100644
index 0000000..65bb00a
--- /dev/null
+++ b/vcpkg/ports/tinyxml/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "tinyxml",
+ "version": "2.6.2",
+ "port-version": 10,
+ "description": "A simple, small, minimal, C++ XML parser that can be easily integrating into other programs.",
+ "homepage": "https://sourceforge.net/projects/tinyxml",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}