2020-01-14 07:43:36 +08:00
|
|
|
# Give the CMake module a little bit of help to find the debug libraries
|
|
|
|
find_library(PostgreSQL_LIBRARY_DEBUG
|
|
|
|
NAMES pq
|
|
|
|
PATHS
|
2020-07-03 02:00:28 +08:00
|
|
|
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib"
|
2020-01-14 07:43:36 +08:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2020-05-09 05:50:29 +08:00
|
|
|
_find_package(${ARGS})
|
2023-06-01 10:55:03 +08:00
|
|
|
if(PostgreSQL_FOUND AND NOT "@VCPKG_TARGET_IS_WINDOWS@")
|
2020-05-09 05:50:29 +08:00
|
|
|
find_library(PostgreSQL_DL_LIBRARY NAMES dl)
|
|
|
|
if(PostgreSQL_DL_LIBRARY)
|
|
|
|
list(APPEND PostgreSQL_LIBRARIES "dl")
|
2020-05-29 04:07:36 +08:00
|
|
|
if(TARGET PostgreSQL::PostgreSQL)
|
|
|
|
set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl")
|
|
|
|
endif()
|
2020-05-09 05:50:29 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-05-01 02:10:51 +08:00
|
|
|
if(PostgreSQL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
|
|
|
include(SelectLibraryConfigurations)
|
|
|
|
foreach(LIB_ITEM libpgport libpgcommon pgport pgcommon)
|
2021-03-20 00:51:52 +08:00
|
|
|
find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE
|
|
|
|
NAMES ${LIB_ITEM}
|
|
|
|
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH
|
|
|
|
)
|
2021-05-01 02:10:51 +08:00
|
|
|
if(TARGET PostgreSQL::PostgreSQL AND PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE)
|
2021-03-20 00:51:52 +08:00
|
|
|
set_property(
|
|
|
|
TARGET PostgreSQL::PostgreSQL
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<NOT:\$<CONFIG:DEBUG>>:${PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE}>"
|
|
|
|
)
|
|
|
|
endif()
|
2021-05-01 02:10:51 +08:00
|
|
|
|
2021-03-20 00:51:52 +08:00
|
|
|
find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG
|
|
|
|
NAMES ${LIB_ITEM}
|
|
|
|
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH
|
|
|
|
)
|
2021-05-01 02:10:51 +08:00
|
|
|
if(TARGET PostgreSQL::PostgreSQL AND PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG)
|
2021-03-20 00:51:52 +08:00
|
|
|
set_property(
|
|
|
|
TARGET PostgreSQL::PostgreSQL
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<CONFIG:DEBUG>:${PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG}>"
|
|
|
|
)
|
|
|
|
endif()
|
2021-05-01 02:10:51 +08:00
|
|
|
|
|
|
|
if (PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE OR PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG)
|
|
|
|
select_library_configurations(PostgreSQL_${LIB_ITEM})
|
|
|
|
list(APPEND PostgreSQL_LIBRARIES ${PostgreSQL_${LIB_ITEM}_LIBRARY})
|
|
|
|
endif()
|
2021-03-20 00:51:52 +08:00
|
|
|
endforeach()
|
2021-06-16 01:33:31 +08:00
|
|
|
if(WIN32)
|
|
|
|
if(TARGET PostgreSQL::PostgreSQL)
|
|
|
|
set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Secur32.lib")
|
|
|
|
endif()
|
|
|
|
list(APPEND PostgreSQL_LIBRARIES Secur32.lib)
|
|
|
|
endif()
|
|
|
|
cmake_policy(PUSH)
|
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
set(Z_VCPKG_PORT_FEATURES "@FEATURES@")
|
|
|
|
if("openssl" IN_LIST Z_VCPKG_PORT_FEATURES)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
if(TARGET PostgreSQL::PostgreSQL)
|
|
|
|
set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "OpenSSL::SSL")
|
|
|
|
endif()
|
|
|
|
list(APPEND PostgreSQL_LIBRARIES OpenSSL::SSL)
|
|
|
|
endif()
|
2023-03-02 03:04:27 +08:00
|
|
|
if(WIN32)
|
|
|
|
if(TARGET PostgreSQL::PostgreSQL)
|
|
|
|
set_property(TARGET PostgreSQL::PostgreSQL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Wldap32.lib")
|
|
|
|
endif()
|
|
|
|
list(APPEND PostgreSQL_LIBRARIES Wldap32.lib)
|
|
|
|
endif()
|
2021-06-16 01:33:31 +08:00
|
|
|
unset(Z_VCPKG_PORT_FEATURES)
|
|
|
|
cmake_policy(POP)
|
2021-03-20 00:51:52 +08:00
|
|
|
endif()
|