From fa7a3eaec35409d60dbc456d5229b54c192f11de Mon Sep 17 00:00:00 2001 From: Chao <6785880+ChaoJia@users.noreply.github.com> Date: Thu, 10 Oct 2019 23:26:40 +0200 Subject: [PATCH] [nlohmann-fifo-map]new port (#8458) * [nlohmann-fifo-map]new port * Formatting; Fix up version --- ports/nlohmann-fifo-map/CMakeLists.txt | 30 ++++++++++++++++++++++++++ ports/nlohmann-fifo-map/CONTROL | 3 +++ ports/nlohmann-fifo-map/portfile.cmake | 29 +++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 ports/nlohmann-fifo-map/CMakeLists.txt create mode 100644 ports/nlohmann-fifo-map/CONTROL create mode 100644 ports/nlohmann-fifo-map/portfile.cmake diff --git a/ports/nlohmann-fifo-map/CMakeLists.txt b/ports/nlohmann-fifo-map/CMakeLists.txt new file mode 100644 index 000000000..5ec3e9532 --- /dev/null +++ b/ports/nlohmann-fifo-map/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.1) +project(nlohmann_fifo_map LANGUAGES CXX) + +include(GNUInstallDirs) + +set(NLOHMANN_FIFO_MAP_TARGET_NAME ${PROJECT_NAME}) +set(NLOHMANN_FIFO_MAP_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/nlohmann") +set(NLOHMANN_FIFO_MAP_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/nlohmann-fifo-map") +set(NLOHMANN_FIFO_MAP_CONFIG_EXPORT_NAME "${PROJECT_NAME}_config") +set(NLOHMANN_FIFO_MAP_INCLUDE_BUILD_DIR "${CMAKE_SOURCE_DIR}/src/") + +add_library(${NLOHMANN_FIFO_MAP_TARGET_NAME} INTERFACE) +add_library(${PROJECT_NAME}::${NLOHMANN_FIFO_MAP_TARGET_NAME} ALIAS ${NLOHMANN_FIFO_MAP_TARGET_NAME}) + +install( + DIRECTORY ${NLOHMANN_FIFO_MAP_INCLUDE_BUILD_DIR} + DESTINATION ${NLOHMANN_FIFO_MAP_INCLUDE_INSTALL_DIR} +) + +install( + TARGETS ${NLOHMANN_FIFO_MAP_TARGET_NAME} EXPORT ${NLOHMANN_FIFO_MAP_CONFIG_EXPORT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +install( + EXPORT ${NLOHMANN_FIFO_MAP_CONFIG_EXPORT_NAME} + DESTINATION ${NLOHMANN_FIFO_MAP_CONFIG_INSTALL_DIR} + NAMESPACE ${PROJECT_NAME}:: +) + diff --git a/ports/nlohmann-fifo-map/CONTROL b/ports/nlohmann-fifo-map/CONTROL new file mode 100644 index 000000000..9a8ec6de2 --- /dev/null +++ b/ports/nlohmann-fifo-map/CONTROL @@ -0,0 +1,3 @@ +Source: nlohmann-fifo-map +Version: 2018.05.07 +Description: a FIFO-ordered associative container for C++ diff --git a/ports/nlohmann-fifo-map/portfile.cmake b/ports/nlohmann-fifo-map/portfile.cmake new file mode 100644 index 000000000..e2b12dc1d --- /dev/null +++ b/ports/nlohmann-fifo-map/portfile.cmake @@ -0,0 +1,29 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO nlohmann/fifo_map + REF 0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9 + SHA512 1e515d02ff49684dc8439ee1f3b9fbece3c727b6f669ee9a251eae8d8bf33eff0a36ab58829956a698cd9bfb757f9c6ade227d601197aa7b824c0584f48e181d + HEAD_REF master +) + +#make sure we don't use any integrated pre-built library nor any unnecessary CMake module +file(REMOVE_RECURSE ${SOURCE_PATH}/test) +file(REMOVE ${SOURCE_PATH}/CMakeLists.txt) + +file(COPY ${CURRENT_PORT_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)