2020-01-14 00:43:36 +01: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-02 11:00:28 -07:00
|
|
|
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib"
|
2020-01-14 00:43:36 +01:00
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2020-05-08 16:50:29 -05:00
|
|
|
_find_package(${ARGS})
|
2020-10-22 21:56:51 -07:00
|
|
|
if(PostgreSQL_FOUND AND @USE_DL@)
|
2020-05-08 16:50:29 -05: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-08 16:50:29 -05:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-03-20 00:51:52 +08:00
|
|
|
if(PostgreSQL_FOUND AND TARGET PostgreSQL::PostgreSQL AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
|
|
|
foreach(LIB_ITEM pgport pgcommon)
|
|
|
|
find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE
|
|
|
|
NAMES ${LIB_ITEM}
|
|
|
|
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
if(PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE)
|
|
|
|
set_property(
|
|
|
|
TARGET PostgreSQL::PostgreSQL
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<NOT:\$<CONFIG:DEBUG>>:${PostgreSQL_${LIB_ITEM}_LIBRARY_RELEASE}>"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
find_library(PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG
|
|
|
|
NAMES ${LIB_ITEM}
|
|
|
|
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH
|
|
|
|
)
|
|
|
|
if(PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG)
|
|
|
|
set_property(
|
|
|
|
TARGET PostgreSQL::PostgreSQL
|
|
|
|
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<CONFIG:DEBUG>:${PostgreSQL_${LIB_ITEM}_LIBRARY_DEBUG}>"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|