mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 05:53:22 +08:00
[Drogon] Add new port (#12024)
* [Drogon] Add new port * Update version * Use cmake options instead of patching
This commit is contained in:
parent
d2b92bff55
commit
7a28379b4c
5
ports/drogon/CONTROL
Normal file
5
ports/drogon/CONTROL
Normal file
@ -0,0 +1,5 @@
|
||||
Source: drogon
|
||||
Version: v1.0.0-beta18
|
||||
Homepage: https://github.com/an-tao/drogon
|
||||
Description:Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows
|
||||
Build-Depends: trantor, zlib, jsoncpp, libmariadb, libpq, sqlite3, brotli
|
20
ports/drogon/drogon_ctl_install.patch
Normal file
20
ports/drogon/drogon_ctl_install.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
|
||||
index bbc01fe..99500f0 100755
|
||||
--- a/drogon_ctl/CMakeLists.txt
|
||||
+++ b/drogon_ctl/CMakeLists.txt
|
||||
@@ -40,13 +40,13 @@ if(WIN32)
|
||||
target_link_libraries(drogon_ctl PRIVATE ws2_32 Rpcrt4)
|
||||
endif(WIN32)
|
||||
message(STATUS "bin:" ${INSTALL_BIN_DIR})
|
||||
-install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
|
||||
+install(TARGETS drogon_ctl RUNTIME DESTINATION tools/drogon)
|
||||
if(WIN32)
|
||||
set(CTL_FILE $<TARGET_FILE:drogon_ctl>)
|
||||
add_custom_command(TARGET drogon_ctl POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCTL_FILE=${CTL_FILE}
|
||||
- -DINSTALL_BIN_DIR=${INSTALL_BIN_DIR}
|
||||
+ -DINSTALL_BIN_DIR=tools/drogon
|
||||
-P
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CopyDlls.cmake)
|
||||
else(WIN32)
|
33
ports/drogon/portfile.cmake
Normal file
33
ports/drogon/portfile.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO an-tao/drogon
|
||||
REF v1.0.0-beta18
|
||||
SHA512 38d57e6b5cc43bd1ac07c980453dda1f4c23a8c78eca942dd531d20661d7f088fc0a3d0f4e7cedddf98bac5a32be0330911cbf839d4956e05ee0265a68c7faa6
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
vcpkg.patch
|
||||
drogon_ctl_install.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Fix CMake files
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/drogon)
|
||||
|
||||
# # Remove includes in debug
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
# Copy pdb files
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/drogon)
|
16
ports/drogon/vcpkg.patch
Normal file
16
ports/drogon/vcpkg.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index aab915d..4daeb87 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -64,9 +64,9 @@ if(WIN32)
|
||||
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
|
||||
endif(WIN32)
|
||||
|
||||
-add_subdirectory(trantor)
|
||||
+find_package(Trantor CONFIG REQUIRED)
|
||||
|
||||
-target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
|
||||
+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor)
|
||||
|
||||
if(NOT WIN32)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE dl)
|
Loading…
x
Reference in New Issue
Block a user