[pthreads4w] update for single config builds, improve downstream compatibility (#24308)

* [pthreads4w] update for single config builds, improve downstream compatibility

* [darknet] remove integrated pthreads cmake module

* [pthreads4w] use config instead of module naming

* fix library search path

* improve downstream compatibility even more

* fix references

* do not store deprecated symbols in PThreads4W cmake config

* fix references

* [pthreads4w] add license

* fix references

* Update ports/pthreads/vcpkg.json

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* add usage

* update refs

Co-authored-by: Billy O'Neal <bion@microsoft.com>
This commit is contained in:
Stefano Sinigardi 2022-06-28 01:45:13 +02:00 committed by GitHub
parent fb7ba25ab2
commit 8eb76645c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 167 additions and 112 deletions

View File

@ -27,9 +27,7 @@ endif()
#make sure we don't use any integrated pre-built library nor any unnecessary CMake module
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty")
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindPThreads_windows.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindCUDNN.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindStb.cmake")
file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/Modules")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"

View File

@ -1,6 +1,7 @@
{
"name": "darknet",
"version-date": "2022-03-06",
"port-version": 1,
"description": "Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities.",
"homepage": "https://github.com/alexeyab/darknet",
"license": null,

View File

@ -46,7 +46,7 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
if(NOT PThreads4W_INCLUDE_DIR)
find_path(PThreads4W_INCLUDE_DIR NAMES pthread.h)
find_path(PThreads4W_INCLUDE_DIR NAMES pthread.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH)
endif()
set(PThreads4W_MAJOR_VERSION 3)
@ -56,18 +56,18 @@ set(PThreads4W_VERSION "${PThreads4W_MAJOR_VERSION}.${PThreads4W_MINOR_VERSION}.
# Allow libraries to be set manually
if(NOT PThreads4W_LIBRARY)
find_library(PThreads4W_LIBRARY_RELEASE NAMES pthreadVC${PThreads4W_MAJOR_VERSION})
find_library(PThreads4W_LIBRARY_DEBUG NAMES pthreadVC${PThreads4W_MAJOR_VERSION}d)
find_library(PThreads4W_LIBRARY_RELEASE NAMES pthreadVC${PThreads4W_MAJOR_VERSION} PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
find_library(PThreads4W_LIBRARY_DEBUG NAMES pthreadVC${PThreads4W_MAJOR_VERSION}d PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
select_library_configurations(PThreads4W)
endif()
if(NOT PThreads4W_CXXEXC_LIBRARY)
find_library(PThreads4W_CXXEXC_LIBRARY_RELEASE NAMES pthreadVCE${PThreads4W_MAJOR_VERSION})
find_library(PThreads4W_CXXEXC_LIBRARY_DEBUG NAMES pthreadVCE${PThreads4W_MAJOR_VERSION}d)
find_library(PThreads4W_CXXEXC_LIBRARY_RELEASE NAMES pthreadVCE${PThreads4W_MAJOR_VERSION} PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
find_library(PThreads4W_CXXEXC_LIBRARY_DEBUG NAMES pthreadVCE${PThreads4W_MAJOR_VERSION}d PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
select_library_configurations(PThreads4W_CXXEXC)
endif()
if(NOT PThreads4W_STRUCTEXC_LIBRARY)
find_library(PThreads4W_STRUCTEXC_LIBRARY_RELEASE NAMES pthreadVSE${PThreads4W_MAJOR_VERSION})
find_library(PThreads4W_STRUCTEXC_LIBRARY_DEBUG NAMES pthreadVSE${PThreads4W_MAJOR_VERSION}d)
find_library(PThreads4W_STRUCTEXC_LIBRARY_RELEASE NAMES pthreadVSE${PThreads4W_MAJOR_VERSION} PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
find_library(PThreads4W_STRUCTEXC_LIBRARY_DEBUG NAMES pthreadVSE${PThreads4W_MAJOR_VERSION}d PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
select_library_configurations(PThreads4W_STRUCTEXC)
endif()
@ -88,23 +88,6 @@ find_file(PThreads4W_CXXEXC_LIBRARY_DEBUG_DLL NAMES pthreadVCE${PThreads4W_MAJOR
find_file(PThreads4W_STRUCTEXC_LIBRARY_RELEASE_DLL NAMES pthreadVSE${PThreads4W_MAJOR_VERSION}.dll PATHS ${PThreads4W_DLL_DIR})
find_file(PThreads4W_STRUCTEXC_LIBRARY_DEBUG_DLL NAMES pthreadVSE${PThreads4W_MAJOR_VERSION}d.dll PATHS ${PThreads4W_DEBUG_DLL_DIR})
#Compatibility definitions, deprecated
set(PTHREAD_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PTHREADS_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PThreads_windows_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PTHREAD_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREADS_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREAD_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREADS_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(LIBPTHREAD ${PThreads4W_LIBRARY} CACHE STRING "")
set(LIBPTHREADS ${PThreads4W_LIBRARY} CACHE STRING "")
set(PThreads_windows_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(PThreads_VERSION "${PThreads4W_VERSION}")
if(PThreads4W_FOUND)
set(PThreads_windows_FOUND TRUE)
endif()
#TARGETS
if( PThreads4W_FOUND AND NOT TARGET PThreads4W::PThreads4W_CXXEXC )
if( EXISTS "${PThreads4W_CXXEXC_LIBRARY_RELEASE_DLL}" )
add_library( PThreads4W::PThreads4W_CXXEXC SHARED IMPORTED )
@ -194,34 +177,3 @@ if( PThreads4W_FOUND AND NOT TARGET PThreads4W::PThreads4W )
endif()
endif()
endif()
#Compatibility targets, deprecated
if( PThreads4W_FOUND AND NOT TARGET PThreads_windows::PThreads_windows )
if( EXISTS "${PThreads4W_LIBRARY_RELEASE_DLL}" )
add_library( PThreads_windows::PThreads_windows SHARED IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG_DLL}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
else()
add_library( PThreads_windows::PThreads_windows UNKNOWN IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
endif()
endif()

View File

@ -12,6 +12,7 @@ if(VCPKG_TARGET_IS_UWP)
# https://docs.microsoft.com/en-us/cpp/build/reference/linking#link-environment-variables
set(ENV{LINK} "/APPCONTAINER")
endif()
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
list(APPEND PATCH_FILES use-md.patch)
else()
@ -38,71 +39,77 @@ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL)
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f Makefile all install
"DESTROOT=\"${INST_DIR_REL}\""
WORKING_DIRECTORY ${SOURCE_PATH}
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME nmake-build-${TARGET_TRIPLET}-release
)
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
################
# Debug build
################
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG)
vcpkg_execute_required_process(
COMMAND ${NMAKE} /G -f Makefile all install
"DESTROOT=\"${INST_DIR_DBG}\""
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME nmake-build-${TARGET_TRIPLET}-debug
)
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/pthreadVC3d.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/pthreadVCE3d.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/pthreadVSE3d.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVC3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVCE3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVSE3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVC3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVCE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVSE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pthreadVC3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pthreadVCE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pthreadVSE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVC3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVCE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVSE3.lib")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVC3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVCE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libpthreadVSE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3d.lib")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpthreadVC3.lib ${CURRENT_PACKAGES_DIR}/lib/pthreadVC3.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpthreadVCE3.lib ${CURRENT_PACKAGES_DIR}/lib/pthreadVCE3.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpthreadVSE3.lib ${CURRENT_PACKAGES_DIR}/lib/pthreadVSE3.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVC3d.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVCE3d.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVSE3d.lib)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libpthreadVC3.lib" "${CURRENT_PACKAGES_DIR}/lib/pthreadVC3.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libpthreadVCE3.lib" "${CURRENT_PACKAGES_DIR}/lib/pthreadVCE3.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libpthreadVSE3.lib" "${CURRENT_PACKAGES_DIR}/lib/pthreadVSE3.lib")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthread)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthreads)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/pthreads_windows)
if(NOT VCPKG_BUILD_TYPE)
################
# Debug build
################
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG)
vcpkg_execute_required_process(
COMMAND ${NMAKE} /G -f Makefile all install
"DESTROOT=\"${INST_DIR_DBG}\""
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME nmake-build-${TARGET_TRIPLET}-debug
)
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVC3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVCE3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/pthreadVSE3.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVC3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVCE3.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVSE3.lib")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3d.lib")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3d.lib")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVC3d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVC3d.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVCE3d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVCE3d.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpthreadVSE3d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/pthreadVSE3d.lib")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
endif()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/PThreads4WConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/PThreads4W")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-pthread.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/pthread" RENAME vcpkg-cmake-wrapper.cmake)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-pthreads.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/pthreads" RENAME vcpkg-cmake-wrapper.cmake)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-pthreads-windows.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/PThreads_windows" RENAME vcpkg-cmake-wrapper.cmake)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)

View File

@ -1,9 +1,4 @@
The package pthreads provides CMake targets:
find_package(pthreads REQUIRED)
find_package(PThreads4W REQUIRED)
target_link_libraries(main PRIVATE PThreads4W::PThreads4W)
#or
target_link_libraries(main PRIVATE PThreads4W::PThreads4W_CXXEXC)
#or
target_link_libraries(main PRIVATE PThreads4W::PThreads4W_STRUCTEXC)

View File

@ -0,0 +1,13 @@
_find_package(PThreads4W)
set(PTHREAD_INCLUDE_DIR "${PThreads4W_INCLUDE_DIR}")
set(PTHREAD_LIBRARY "${PThreads4W_LIBRARY}")
set(PTHREAD_LIBRARIES "${PThreads4W_LIBRARY}")
set(PTHREAD_VERSION "${PThreads4W_VERSION}")
set(LIBPTHREAD "${PThreads4W_LIBRARY}")
set(LIBPTHREADS "${PThreads4W_LIBRARY}")
if(PThreads4W_FOUND)
set(PTHREAD_FOUND TRUE)
set(LIBPTHREAD_FOUND TRUE)
set(LIBPTHREADS_FOUND TRUE)
endif()

View File

@ -0,0 +1,39 @@
_find_package(PThreads4W)
set(PThreads_windows_INCLUDE_DIR "${PThreads4W_INCLUDE_DIR}")
set(PThreads_windows_LIBRARY "${PThreads4W_LIBRARY}")
set(PThreads_windows_LIBRARIES "${PThreads4W_LIBRARY}")
set(PThreads_windows_VERSION "${PThreads4W_VERSION}")
if(PThreads4W_FOUND)
set(PThreads_windows_FOUND TRUE)
if(NOT TARGET PThreads_windows::PThreads_windows)
if( EXISTS "${PThreads4W_LIBRARY_RELEASE_DLL}" )
add_library( PThreads_windows::PThreads_windows SHARED IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG_DLL}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
else()
add_library( PThreads_windows::PThreads_windows UNKNOWN IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
endif()
endif()
endif()

View File

@ -0,0 +1,39 @@
_find_package(PThreads4W)
set(pthreads_INCLUDE_DIR "${PThreads4W_INCLUDE_DIR}")
set(pthreads_LIBRARY "${PThreads4W_LIBRARY}")
set(pthreads_LIBRARIES "${PThreads4W_LIBRARY}")
set(pthreads_VERSION "${PThreads4W_VERSION}")
if(PThreads4W_FOUND)
set(pthreads_FOUND TRUE)
if(NOT TARGET PThreads_windows::PThreads_windows)
if( EXISTS "${PThreads4W_LIBRARY_RELEASE_DLL}" )
add_library( PThreads_windows::PThreads_windows SHARED IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG_DLL}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
else()
add_library( PThreads_windows::PThreads_windows UNKNOWN IMPORTED )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_RELEASE "${PThreads4W_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
if( EXISTS "${PThreads4W_LIBRARY_DEBUG}" )
set_property( TARGET PThreads_windows::PThreads_windows APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( PThreads_windows::PThreads_windows PROPERTIES
IMPORTED_LOCATION_DEBUG "${PThreads4W_LIBRARY_DEBUG}" )
endif()
endif()
endif()
endif()

View File

@ -1,7 +1,8 @@
{
"name": "pthreads",
"version": "3.0.0",
"port-version": 10,
"description": "pthreads for windows",
"homepage": "https://sourceware.org/pub/pthreads-win32/"
"port-version": 11,
"description": "Meta-package that provides PThreads4W on Windows, or assumes presence of system pthreads on POSIX systems.",
"homepage": "https://sourceforge.net/projects/pthreads4w/",
"license": "Apache-2.0"
}

View File

@ -1794,7 +1794,7 @@
},
"darknet": {
"baseline": "2022-03-06",
"port-version": 0
"port-version": 1
},
"darts-clone": {
"baseline": "1767ab87cffe",
@ -5666,7 +5666,7 @@
},
"pthreads": {
"baseline": "3.0.0",
"port-version": 10
"port-version": 11
},
"ptyqt": {
"baseline": "0.6.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0e4e40d483fe8ff2bade4fe1b10996cf71f3089b",
"version-date": "2022-03-06",
"port-version": 1
},
{
"git-tree": "b9b918e6e0af651d83b284cd0f423b6b49951aef",
"version-date": "2022-03-06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "05aad80a1b8fa9b224b736efb6f5f06baddfb0ec",
"version": "3.0.0",
"port-version": 11
},
{
"git-tree": "ab9d25f08115355ea2d4e4c6eae94626fa86fded",
"version": "3.0.0",