aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libxmlmm
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libxmlmm')
-rw-r--r--vcpkg/ports/libxmlmm/CMakeLists.txt63
-rw-r--r--vcpkg/ports/libxmlmm/portfile.cmake26
-rw-r--r--vcpkg/ports/libxmlmm/unofficial-libxmlmm-config.cmake3
-rw-r--r--vcpkg/ports/libxmlmm/vcpkg.json22
4 files changed, 114 insertions, 0 deletions
diff --git a/vcpkg/ports/libxmlmm/CMakeLists.txt b/vcpkg/ports/libxmlmm/CMakeLists.txt
new file mode 100644
index 0000000..98b281f
--- /dev/null
+++ b/vcpkg/ports/libxmlmm/CMakeLists.txt
@@ -0,0 +1,63 @@
+cmake_minimum_required(VERSION 3.8)
+project(libxmlmm CXX)
+
+find_package(LibXml2 REQUIRED)
+
+set(HEADERS_LIBXMLMM
+ libxmlmm/Attribute.h
+ libxmlmm/CData.h
+ libxmlmm/Comment.h
+ libxmlmm/Content.h
+ libxmlmm/defines.h
+ libxmlmm/Document.h
+ libxmlmm/Element.h
+ libxmlmm/exceptions.h
+ libxmlmm/libxmlmm.h
+ libxmlmm/LibXmlSentry.h
+ libxmlmm/Node.h
+ libxmlmm/ProcessingInstruction.h
+ libxmlmm/Text.h
+ libxmlmm/utils.h
+)
+
+set(SOURCES_LIBXMLMM
+ libxmlmm/Attribute.cpp
+ libxmlmm/CData.cpp
+ libxmlmm/Comment.cpp
+ libxmlmm/Content.cpp
+ libxmlmm/Document.cpp
+ libxmlmm/Element.cpp
+ libxmlmm/LibXmlSentry.cpp
+ libxmlmm/Node.cpp
+ libxmlmm/ProcessingInstruction.cpp
+ libxmlmm/Text.cpp
+ libxmlmm/utils.cpp
+)
+
+add_library(libxmlmm ${SOURCES_LIBXMLMM})
+target_link_libraries (libxmlmm PUBLIC LibXml2::LibXml2)
+
+set_target_properties(libxmlmm PROPERTIES
+ CXX_STANDARD 17
+ PUBLIC_HEADER "${HEADERS_LIBXMLMM}"
+ OUTPUT_NAME xmlmm
+)
+
+target_include_directories(libxmlmm PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libxmlmm>
+ $<INSTALL_INTERFACE:include/libxmlmm>)
+
+install(TARGETS libxmlmm
+ EXPORT unofficial-libxmlmm-targets
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ PUBLIC_HEADER DESTINATION include/libxmlmm
+)
+install(EXPORT unofficial-libxmlmm-targets
+ NAMESPACE unofficial::libxmlmm::
+ DESTINATION share/unofficial-libxmlmm
+)
+
+configure_file(libxmlmm.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libxmlmm.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxmlmm.pc DESTINATION lib/pkgconfig)
diff --git a/vcpkg/ports/libxmlmm/portfile.cmake b/vcpkg/ports/libxmlmm/portfile.cmake
new file mode 100644
index 0000000..c13f65f
--- /dev/null
+++ b/vcpkg/ports/libxmlmm/portfile.cmake
@@ -0,0 +1,26 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO rioki/libxmlmm
+ REF r0.6
+ SHA512 4f619e730de2f88b891ef31dd7ced2e6be75fff7f3852ec178843bf8d099d2e1ea84e0fcde35ff7fefc201b026f63e4b5d55f88e48334c49a0333be0327894df
+ HEAD_REF master
+)
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DVERSION=${VERSION}
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-libxmlmm-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-libxmlmm")
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libxmlmm)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(READ "${SOURCE_PATH}/README.md" readme)
+string(REGEX REPLACE "^.*## Copying\n" "" copyright "${readme}")
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${copyright}")
diff --git a/vcpkg/ports/libxmlmm/unofficial-libxmlmm-config.cmake b/vcpkg/ports/libxmlmm/unofficial-libxmlmm-config.cmake
new file mode 100644
index 0000000..b56118b
--- /dev/null
+++ b/vcpkg/ports/libxmlmm/unofficial-libxmlmm-config.cmake
@@ -0,0 +1,3 @@
+include(CMakeFindDependencyMacro)
+find_dependency(LibXml2)
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-libxmlmm-targets.cmake")
diff --git a/vcpkg/ports/libxmlmm/vcpkg.json b/vcpkg/ports/libxmlmm/vcpkg.json
new file mode 100644
index 0000000..488051a
--- /dev/null
+++ b/vcpkg/ports/libxmlmm/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "libxmlmm",
+ "version": "0.6.0",
+ "port-version": 4,
+ "description": "Libxmlmm is a C++ wrapper for libxml 2.0 that only relies on standard C++ and libxml2.",
+ "homepage": "https://github.com/rioki/libxmlmm",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "libxml2",
+ "default-features": false
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}