vcpkg/ports/pthreads/vcpkg-cmake-wrapper-pthreads.cmake
Stefano Sinigardi 8eb76645c0
[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>
2022-06-27 16:45:13 -07:00

40 lines
2.0 KiB
CMake

_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()