From 8eb76645c009c2a2e778e03bcbfb9b5e1be3aa40 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 28 Jun 2022 01:45:13 +0200 Subject: [PATCH] [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 * add usage * update refs Co-authored-by: Billy O'Neal --- ports/darknet/portfile.cmake | 4 +- ports/darknet/vcpkg.json | 1 + ...e-wrapper.cmake => PThreads4WConfig.cmake} | 62 ++----------- ports/pthreads/portfile.cmake | 93 ++++++++++--------- ports/pthreads/usage | 7 +- .../vcpkg-cmake-wrapper-pthread.cmake | 13 +++ ...vcpkg-cmake-wrapper-pthreads-windows.cmake | 39 ++++++++ .../vcpkg-cmake-wrapper-pthreads.cmake | 39 ++++++++ ports/pthreads/vcpkg.json | 7 +- versions/baseline.json | 4 +- versions/d-/darknet.json | 5 + versions/p-/pthreads.json | 5 + 12 files changed, 167 insertions(+), 112 deletions(-) rename ports/pthreads/{vcpkg-cmake-wrapper.cmake => PThreads4WConfig.cmake} (75%) create mode 100644 ports/pthreads/vcpkg-cmake-wrapper-pthread.cmake create mode 100644 ports/pthreads/vcpkg-cmake-wrapper-pthreads-windows.cmake create mode 100644 ports/pthreads/vcpkg-cmake-wrapper-pthreads.cmake diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake index 5274e101b6..f4438996c6 100644 --- a/ports/darknet/portfile.cmake +++ b/ports/darknet/portfile.cmake @@ -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}" diff --git a/ports/darknet/vcpkg.json b/ports/darknet/vcpkg.json index 0f4c99a52c..bd6f05a4d0 100644 --- a/ports/darknet/vcpkg.json +++ b/ports/darknet/vcpkg.json @@ -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, diff --git a/ports/pthreads/vcpkg-cmake-wrapper.cmake b/ports/pthreads/PThreads4WConfig.cmake similarity index 75% rename from ports/pthreads/vcpkg-cmake-wrapper.cmake rename to ports/pthreads/PThreads4WConfig.cmake index f9818d3845..a3a132e9ff 100644 --- a/ports/pthreads/vcpkg-cmake-wrapper.cmake +++ b/ports/pthreads/PThreads4WConfig.cmake @@ -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() diff --git a/ports/pthreads/portfile.cmake b/ports/pthreads/portfile.cmake index 47493940e6..1256e692dd 100644 --- a/ports/pthreads/portfile.cmake +++ b/ports/pthreads/portfile.cmake @@ -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) diff --git a/ports/pthreads/usage b/ports/pthreads/usage index 343c97f440..69dcfd08c2 100644 --- a/ports/pthreads/usage +++ b/ports/pthreads/usage @@ -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) \ No newline at end of file diff --git a/ports/pthreads/vcpkg-cmake-wrapper-pthread.cmake b/ports/pthreads/vcpkg-cmake-wrapper-pthread.cmake new file mode 100644 index 0000000000..0d0515ce59 --- /dev/null +++ b/ports/pthreads/vcpkg-cmake-wrapper-pthread.cmake @@ -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() diff --git a/ports/pthreads/vcpkg-cmake-wrapper-pthreads-windows.cmake b/ports/pthreads/vcpkg-cmake-wrapper-pthreads-windows.cmake new file mode 100644 index 0000000000..e648ecf640 --- /dev/null +++ b/ports/pthreads/vcpkg-cmake-wrapper-pthreads-windows.cmake @@ -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() diff --git a/ports/pthreads/vcpkg-cmake-wrapper-pthreads.cmake b/ports/pthreads/vcpkg-cmake-wrapper-pthreads.cmake new file mode 100644 index 0000000000..453c5c24ad --- /dev/null +++ b/ports/pthreads/vcpkg-cmake-wrapper-pthreads.cmake @@ -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() diff --git a/ports/pthreads/vcpkg.json b/ports/pthreads/vcpkg.json index db809649bf..7fe191e795 100644 --- a/ports/pthreads/vcpkg.json +++ b/ports/pthreads/vcpkg.json @@ -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" } diff --git a/versions/baseline.json b/versions/baseline.json index 86def13a30..4bf1bd54be 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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", diff --git a/versions/d-/darknet.json b/versions/d-/darknet.json index 644996618b..99920f74d2 100644 --- a/versions/d-/darknet.json +++ b/versions/d-/darknet.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0e4e40d483fe8ff2bade4fe1b10996cf71f3089b", + "version-date": "2022-03-06", + "port-version": 1 + }, { "git-tree": "b9b918e6e0af651d83b284cd0f423b6b49951aef", "version-date": "2022-03-06", diff --git a/versions/p-/pthreads.json b/versions/p-/pthreads.json index 78edfdfedf..324dfb304e 100644 --- a/versions/p-/pthreads.json +++ b/versions/p-/pthreads.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "05aad80a1b8fa9b224b736efb6f5f06baddfb0ec", + "version": "3.0.0", + "port-version": 11 + }, { "git-tree": "ab9d25f08115355ea2d4e4c6eae94626fa86fded", "version": "3.0.0",