Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
16a5fa3
improvement: has oatpp package
Dec 7, 2019
dc47c1f
[oatpp] includes _CRT_SECURE_NO_WARNINGS compile-time flag
mheyman Dec 7, 2019
4654de9
Merge branch 'master' of github.com:microsoft/vcpkg
Dec 14, 2019
87c2cd1
[oatpp] no curl submodule (until it catches up with core)
Dec 14, 2019
84b766a
Merge branch 'master' of github.com:microsoft/vcpkg
Dec 21, 2019
0c64e30
[oatpp] now version 0.19.11. Still no libretls module because of libr…
mheyman Dec 21, 2019
8e30885
no accidentally added debug messages in vcpkg_execute_build_process.c…
Dec 21, 2019
ba143d0
[oatpp] no empty depends line in CONTROL file
mheyman Dec 24, 2019
ba8e396
[oatpp] no dump_variables() function in portfile.cmake
mheyman Dec 24, 2019
3df2109
[oatpp] no wwrning that only static libraries are supported
mheyman Dec 24, 2019
0282cfb
[oatpp] uses vcpkg_check_linkage(ONLY_STATIC_LIBRARY) call
mheyman Dec 24, 2019
9a6cd53
[oatpp] curl submodule does not rely on pkg-config
mheyman Dec 24, 2019
f92bc99
[oatpp] curl-submodule-no-pkg-config-in-vcpkg works on linux and windows
mheyman Dec 26, 2019
d74b0fa
Merge branch 'master' of github.com:microsoft/vcpkg
mheyman Dec 26, 2019
82a0c6e
[oatpp] portfile cleaned up
mheyman Dec 26, 2019
2d86e3c
[oatpp] no carriage returns in patch
mheyman Dec 27, 2019
722d995
Merge branch 'master' of github.com:microsoft/vcpkg
Jan 25, 2020
61dfe2f
Merge branch 'master' of github.com:mheyman/vcpkg
Jan 25, 2020
2e072be
[oatpp]: split modules into their own ports
Jan 25, 2020
850cdeb
[oatpp-libressl]: remove variable dump
Jan 25, 2020
fb65501
[libressl]: has check for UWP and ARM restored
Jan 25, 2020
3391368
[libressl]: has check for UWP and ARM restored
Jan 25, 2020
92cda2e
[libressl]: has check for UWP and ARM restored
Jan 25, 2020
6fb2512
[oatpp-libressl]: builds if libressl works
Jan 25, 2020
0243c44
[oatpp]: version 1.0.0
Jan 28, 2020
6843332
Merge branch 'master' of github.com:microsoft/vcpkg
Feb 8, 2020
cf47c92
[oatpp]: no "Building ..." message
Feb 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ports/oatpp/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Source: oatpp
Version: 0.19.11
Description: Modern web framework

Feature:consul
Description: Consul submodule

Feature:curl
Build-Depends: curl
Description: Use libcurl as a RequestExecutor on the oatpp's ApiClient (external dependency on pkg-config)

Feature:mbedtls
Build-Depends: mbedtls
Description: Mbed TLS submodule providing secure server and client connection providers

Feature:swagger
Description: OpenApi (Swagger) UI submodule

Feature:websocket
Description: websocket submodule

33 changes: 33 additions & 0 deletions ports/oatpp/curl-submodule-no-pkg-config-in-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 477064a..5da99e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,8 +95,26 @@ message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n")
##############################
## Find libcurl dependency

-include(FindPkgConfig)
-pkg_check_modules(PKG_CURL REQUIRED libcurl)
+if (VCPKG_TOOLCHAIN)
+ find_package(CURL REQUIRED)
+ if (CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$")
+ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_DEBUG} NAME)
+ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_DEBUG} DIRECTORY)
+ else()
+ get_filename_component(PKG_CURL_LIBRARIES ${CURL_LIBRARY_RELEASE} NAME)
+ get_filename_component(PKG_CURL_LIBRARY_DIR ${CURL_LIBRARY_RELEASE} DIRECTORY)
+ endif()
+ if (PKG_CURL_LIBRARIES MATCHES [[^.*\.a$]])
+ string(LENGTH ${PKG_CURL_LIBRARIES} _LEN)
+ math(EXPR _LEN "${_LEN} - 5")
+ string(SUBSTRING ${PKG_CURL_LIBRARIES} 3 ${_LEN} PKG_CURL_LIBRARIES)
+ endif()
+ set(PKG_CURL_VERSION ${CURL_VERSION})
+ set(PKG_CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
+else()
+ include(FindPkgConfig)
+ pkg_check_modules(PKG_CURL REQUIRED libcurl)
+endif()

message("[libcurl] libcurl found:")
message("[libcurl] LIBRARIES=${PKG_CURL_LIBRARIES}")
192 changes: 192 additions & 0 deletions ports/oatpp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
set(OATPP_VERSION "0.19.11")

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
# For when OATPP dynamic linkage builds:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need this code, please delete these commented codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OATPP_VERSION variable is required.

Oat++ doesn't build with dynamic linkage - I've started looking into the changes necessary and, while I'm no expert on C++ classes in DLLs and shared libraries, I think the changes would be pretty extensive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is OATPP_BUILD_SHARED_LIBRARIES_OPTION is used in vcpkg_configure_cmake, but it is commented out here.

# if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
# set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "-DBUILD_SHARED_LIBS:BOOL=ON")
# else()
# set(OATPP_BUILD_SHARED_LIBRARIES_OPTION "-DBUILD_SHARED_LIBS:BOOL=OFF")
# endif()

message(STATUS "Building oatpp[core]")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO oatpp/oatpp
REF 857315c01e9318c7e72665ed222565d583f32a98 # 0.19.11
SHA512 835b0239ceb3677fb746e23f33409a060dff88e6b037932c7e66e664b122643b25c4e8996201e6539c3effdc165311ba4e7a4feefb5b3c670b59a69babd85888
HEAD_REF master
)

vcpkg_configure_cmake(
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-DOATPP_BUILD_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS"
${OATPP_BUILD_SHARED_LIBRARIES_OPTION}
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-${OATPP_VERSION})
vcpkg_copy_pdbs()

if("consul" IN_LIST FEATURES)
message(STATUS "Building submodule oatpp[consul]")
vcpkg_from_github(
OUT_SOURCE_PATH CONSUL_SOURCE_PATH
REPO oatpp/oatpp-consul
REF d9b819eed29a3373b61e8e8306d13d0840572318 # 0.19.11
SHA512 d16e6cb4e2ab5e6d71e9036f13b976f00b54631a31516e9adc7cd92141f40a4f7bfa6dc9602a326ca1d7a540d404c9189b1b302ff5a24fdac65cdfe46cb68c7b
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH "${CONSUL_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS"
${OATPP_BUILD_SHARED_LIBRARIES_OPTION}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-consul-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

if("curl" IN_LIST FEATURES)
message(STATUS "Building submodule oatpp[curl]")

# find_package(CURL REQUIRED)

# get the source
vcpkg_from_github(
OUT_SOURCE_PATH CURL_SOURCE_PATH
REPO oatpp/oatpp-curl
REF 5354e78707184cdfe3fb36af5735481d1159c3a6 # 0.19.11
SHA512 3a40b6a6981253c7551c0784fed085403272497840874eb7ea09c7a83c9d86c5fcbf36cf6059d6f067c606fc65b2870806e20f8ffacfef605be4c824804b6bb9
HEAD_REF master
PATCHES "curl-submodule-no-pkg-config-in-vcpkg.patch"
)

vcpkg_configure_cmake(
SOURCE_PATH "${CURL_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS"
${OATPP_BUILD_SHARED_LIBRARIES_OPTION}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-curl-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

if("libressl" IN_LIST FEATURES)
# Unfortunately, this submodule requires libressl 3.0 and vcpkg is at 2.9.1-2
# The available mbedtls or curl module probably cover most libressl scenarios.
#
# When we get past this problem, add the following to the CONTROL file:
# Feature:libressl
# Build-Depends: libressl
# Description: LibreSSL submodule providing secure server and client connection provider (external dependency on pkg-config)


message(STATUS "Building submodule oatpp[libressl]")

# this submodule requires pkg-config (boo)
verify_pkg_config("libressl")

# get the source
vcpkg_from_github(
OUT_SOURCE_PATH LIBRESSL_SOURCE_PATH
REPO oatpp/oatpp-libressl
REF 7daae69903975aa7ac2705ea03320c724b4da502 # 0.19.11
SHA512 b09accccd65520dca8f850e48d1b7c3f22752abb733eb3b7ea13ad285079479ca8addeabec9054dc3dcba0632b94c4db98af3c99c3e99d159eaa32cf6dbe3c96
HEAD_REF master
)

vcpkg_configure_cmake(
SOURCE_PATH "${LIBRESSL_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS"
"-DLIBRESSL_ROOT_DIR=${CURRENT_INSTALLED_DIR}"
${OATPP_BUILD_SHARED_LIBRARIES_OPTION}
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-libressl-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

if("mbedtls" IN_LIST FEATURES)
message(STATUS "Building submodule oatpp[mbedtls]")
vcpkg_from_github(
OUT_SOURCE_PATH MBEDTLS_SOURCE_PATH
REPO oatpp/oatpp-mbedtls
REF 269db6a2a04ea25367d24baccca1883fffb4bbc0 # 0.19.11
SHA512 2581c34a544b02130ebfadf835c61f51028484a2dab7b226d13b75fdfe546d4217989a778d1ed7fe08ad8c7d2713af7590bd4c8604a750162a16f7be44323e87
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH "${MBEDTLS_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-mbedtls-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

if("swagger" IN_LIST FEATURES)
message(STATUS "Building submodule oatpp[swagger]")
vcpkg_from_github(
OUT_SOURCE_PATH SWAGGER_SOURCE_PATH
REPO oatpp/oatpp-swagger
REF 69a606770648f3d589deb9eb796bdb28525d941e # 0.19.11
SHA512 468871af0a8de3527d050a43c449881eb6fa9fb2279bc81bbb276d175b3d41dd48e33f03da54eb53b9749d9fc7c44e4037876e740d4213ecd93ce72ea8c2561e
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH "${SWAGGER_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-D_CRT_SECURE_NO_WARNINGS"
${OATPP_BUILD_SHARED_LIBRARIES_OPTION}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-swagger-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

if("websocket" IN_LIST FEATURES)
message(STATUS "Building submodule oatpp[websocket]")
vcpkg_from_github(
OUT_SOURCE_PATH WEBSOCKET_SOURCE_PATH
REPO oatpp/oatpp-websocket
REF be56875d6d87446e932498de3f390589fc51ee97 # 0.19.11
SHA512 4fce4f55b8aa144b7b9153a759f87dec075e9d6338b3a668448f35fce457626236bab012f41af660a877444b97574490f5c707e354bcb9cb1a9d03c2e5dfe019
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH "${WEBSOCKET_SOURCE_PATH}"
PREFER_NINJA
OPTIONS
"-Doatpp_DIR=${CURRENT_PACKAGES_DIR}/share/oatpp"
"-DOATPP_BUILD_TESTS:BOOL=OFF"
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/oatpp-websocket-${OATPP_VERSION})
vcpkg_copy_pdbs()
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)