2020-08-19 07:45:41 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO an-tao/drogon
|
2023-10-03 11:48:58 +08:00
|
|
|
REF "v${VERSION}"
|
2024-02-10 12:40:41 +08:00
|
|
|
SHA512 cb1ace1e6fcc9112c71c221d24b80dea62245b908037f5f1065b899c62142c568f0e3410a06210ddb599f7771b56ea8acd1c7b5070893f4effb07cfd4b61f8e4
|
2020-08-19 07:45:41 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2023-10-03 11:48:58 +08:00
|
|
|
0001-vcpkg.patch
|
|
|
|
0002-drogon-config.patch
|
|
|
|
0003-deps-redis.patch
|
|
|
|
0004-drogon-ctl.patch
|
2023-10-10 06:07:33 +08:00
|
|
|
0005-drogon-cross-compile.patch
|
2021-02-03 06:35:45 +08:00
|
|
|
)
|
|
|
|
|
2023-10-10 06:07:33 +08:00
|
|
|
set(DROGON_CTL_TOOL "")
|
|
|
|
if(VCPKG_CROSSCOMPILING)
|
|
|
|
set(DROGON_CTL_TOOL "${CURRENT_HOST_INSTALLED_DIR}/tools/drogon/drogon_ctl${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
|
|
|
endif()
|
|
|
|
|
2021-02-03 06:35:45 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-03-20 00:51:52 +08:00
|
|
|
FEATURES
|
2021-07-27 01:54:38 +08:00
|
|
|
ctl BUILD_CTL
|
|
|
|
mysql BUILD_MYSQL
|
|
|
|
orm BUILD_ORM
|
|
|
|
postgres BUILD_POSTGRESQL
|
|
|
|
postgres LIBPQ_BATCH_MODE
|
|
|
|
redis BUILD_REDIS
|
|
|
|
sqlite3 BUILD_SQLITE
|
2023-12-19 05:40:33 +08:00
|
|
|
yaml BUILD_YAML_CONFIG
|
2020-08-19 07:45:41 +08:00
|
|
|
)
|
|
|
|
|
2021-11-06 04:01:35 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DROGON_SHARED)
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-08-31 10:27:37 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2020-08-19 07:45:41 +08:00
|
|
|
OPTIONS
|
2022-09-07 03:46:47 +08:00
|
|
|
-DBUILD_SHARED_LIBS=${BUILD_DROGON_SHARED}
|
2020-08-19 07:45:41 +08:00
|
|
|
-DBUILD_EXAMPLES=OFF
|
2021-03-20 00:51:52 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
|
2023-03-25 12:43:03 +08:00
|
|
|
-DUSE_SUBMODULE=OFF
|
2023-10-10 06:07:33 +08:00
|
|
|
"-DDROGON_CTL_TOOL=${DROGON_CTL_TOOL}"
|
2023-12-19 05:40:33 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2021-11-06 04:01:35 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_Boost
|
2020-08-19 07:45:41 +08:00
|
|
|
)
|
|
|
|
|
2021-11-06 04:01:35 +08:00
|
|
|
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
2020-08-19 07:45:41 +08:00
|
|
|
|
|
|
|
# Fix CMake files
|
2021-11-06 04:01:35 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Drogon)
|
2021-07-01 22:36:43 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2020-08-22 00:31:22 +08:00
|
|
|
# Copy drogon_ctl
|
2021-02-03 06:35:45 +08:00
|
|
|
if("ctl" IN_LIST FEATURES)
|
2021-11-06 04:01:35 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES drogon_ctl AUTO_CLEAN)
|
2021-02-03 06:35:45 +08:00
|
|
|
endif()
|
2021-03-20 00:51:52 +08:00
|
|
|
|
2021-11-06 04:01:35 +08:00
|
|
|
# Remove includes in debug
|
2020-08-19 07:45:41 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2021-11-06 04:01:35 +08:00
|
|
|
|
2022-01-11 13:48:15 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-11-06 04:01:35 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2020-08-19 07:45:41 +08:00
|
|
|
|
|
|
|
# Copy pdb files
|
|
|
|
vcpkg_copy_pdbs()
|