[soci] Fix usage (#34436)

This commit is contained in:
Kai Pastor 2023-10-13 20:05:30 +02:00 committed by GitHub
parent 582472e604
commit 7973b37fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 9 deletions

View File

@ -55,12 +55,20 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(READ "${CURRENT_PORT_DIR}/usage" usage)
set(backends ${FEATURES})
list(REMOVE_ITEM backends core boost)
if(backends STREQUAL "")
message(STATUS "Attention:\n\nThis soci build doesn't include any backends.\n")
set(backends "none")
string(APPEND usage "
This soci build doesn't include any backend and may not be useful.
")
endif()
configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
foreach(backend IN LISTS backends)
string(APPEND usage "
# Using the ${backend} backend directly
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_${backend}>,SOCI::soci_${backend},SOCI::soci_${backend}_static>)
")
endforeach()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE_1_0.txt")

View File

@ -1,7 +1,5 @@
soci provides CMake targets:
find_package(soci CONFIG REQUIRED)
find_package(SOCI CONFIG REQUIRED)
# Using core (loading backends at runtime)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_core>,SOCI::soci_core,SOCI::soci_core_static>)
# Linking specific backends (enabled: @backends@)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_<BACKEND>,SOCI::soci_<BACKEND>,SOCI::soci_<BACKEND>_static>)

View File

@ -1,7 +1,7 @@
{
"name": "soci",
"version": "4.0.3",
"port-version": 2,
"port-version": 3,
"description": "SOCI - The C++ Database Access Library",
"homepage": "https://soci.sourceforge.net/",
"license": "BSL-1.0",

View File

@ -7826,7 +7826,7 @@
},
"soci": {
"baseline": "4.0.3",
"port-version": 2
"port-version": 3
},
"socket-io-client": {
"baseline": "2023-02-14",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "24c340284022dab38da690548caa65c4f003bb7c",
"version": "4.0.3",
"port-version": 3
},
{
"git-tree": "63f4471adc41e108aed34cd585a06e354f1b4762",
"version": "4.0.3",