From 001df4c9e8cee12bbe669b4aeddd1f085d7a7586 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Wed, 17 Jul 2019 06:43:41 +0800 Subject: [PATCH] [mongoose] Add new port (#7089) * [mongoose] Add new port * [mongoose] About UWP * [mongoose] Take advantage of cmake 3.14 improvements --- ports/mongoose/CMakeLists.txt | 20 ++++++++++++++++++++ ports/mongoose/CONTROL | 4 ++++ ports/mongoose/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 ports/mongoose/CMakeLists.txt create mode 100644 ports/mongoose/CONTROL create mode 100644 ports/mongoose/portfile.cmake diff --git a/ports/mongoose/CMakeLists.txt b/ports/mongoose/CMakeLists.txt new file mode 100644 index 0000000000..77fe2f8396 --- /dev/null +++ b/ports/mongoose/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.14) + +project(mongoose C) + +include(GNUInstallDirs) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +add_library(mongoose mongoose.c) +target_include_directories(mongoose PUBLIC $) +set_target_properties(mongoose PROPERTIES PUBLIC_HEADER mongoose.h) + +install(TARGETS mongoose EXPORT unofficial-mongoose-config) + +install( + EXPORT unofficial-mongoose-config + NAMESPACE unofficial::mongoose:: + DESTINATION share/unofficial-mongoose + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) diff --git a/ports/mongoose/CONTROL b/ports/mongoose/CONTROL new file mode 100644 index 0000000000..ae0bbc7582 --- /dev/null +++ b/ports/mongoose/CONTROL @@ -0,0 +1,4 @@ +Source: mongoose +Version: 6.15-1 +Description: Embedded web server / embedded networking library +Homepage: https://cesanta.com/ diff --git a/ports/mongoose/portfile.cmake b/ports/mongoose/portfile.cmake new file mode 100644 index 0000000000..81c8d50ee6 --- /dev/null +++ b/ports/mongoose/portfile.cmake @@ -0,0 +1,34 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "${PORT} does not currently support UWP") +endif() + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cesanta/mongoose + REF 6.15 + SHA512 d736aeb9ccb7a67fb8180ed324d3fa26e005bfc2ede1db00d73349976bfcfb45489ce3efb178817937fae3cd9f6a6e9c4b620af8517e3ace9c53b9541539bdde + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +# CMake integration test +vcpkg_test_cmake(PACKAGE_NAME unofficial-${PORT})