[pthreads4W] vcpkg wrapper fixes (#7178)

* [pthreads4W] restore compatibility with projects using pthreads v2, set proper VERSION symbol
* [pthreads4W] remove FORCED cached variables, to enable user override
This commit is contained in:
Stefano Sinigardi 2019-07-10 08:16:29 +02:00 committed by Phil Christensen
parent 9b861040d6
commit bb417d3beb
2 changed files with 16 additions and 13 deletions

View File

@ -1,4 +1,4 @@
Source: pthreads Source: pthreads
Version: 3.0.0-1 Version: 3.0.0-2
Homepage: https://sourceware.org/pub/pthreads-win32/ Homepage: https://sourceware.org/pub/pthreads-win32/
Description: pthreads for windows Description: pthreads for windows

View File

@ -52,7 +52,7 @@ endif()
set(PThreads4W_MAJOR_VERSION 3) set(PThreads4W_MAJOR_VERSION 3)
set(PThreads4W_MINOR_VERSION 0) set(PThreads4W_MINOR_VERSION 0)
set(PThreads4W_PATCH_VERSION 0) set(PThreads4W_PATCH_VERSION 0)
set(PThreads_VERSION "${PThreads4W_MAJOR_VERSION}.${PThreads4W_MINOR_VERSION}.${PThreads4W_PATCH_VERSION}") set(PThreads4W_VERSION "${PThreads4W_MAJOR_VERSION}.${PThreads4W_MINOR_VERSION}.${PThreads4W_PATCH_VERSION}")
# Allow libraries to be set manually # Allow libraries to be set manually
if(NOT PThreads4W_LIBRARY) if(NOT PThreads4W_LIBRARY)
@ -83,17 +83,20 @@ find_package_handle_standard_args(PThreads4W DEFAULT_MSG PThreads4W_LIBRARY PThr
mark_as_advanced(PThreads4W_INCLUDE_DIR PThreads4W_LIBRARY PThreads4W_CXXEXC_LIBRARY PThreads4W_STRUCTEXC_LIBRARY) mark_as_advanced(PThreads4W_INCLUDE_DIR PThreads4W_LIBRARY PThreads4W_CXXEXC_LIBRARY PThreads4W_STRUCTEXC_LIBRARY)
#Compatibility definitions, deprecated #Compatibility definitions, deprecated
set(PTHREAD_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) set(PTHREAD_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PTHREADS_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) set(PTHREADS_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PThreads_windows_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) set(PThreads_windows_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "")
set(PTHREAD_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(PTHREAD_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREADS_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(PTHREADS_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREAD_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(PTHREAD_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(PTHREADS_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(PTHREADS_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(LIBPTHREAD ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(LIBPTHREAD ${PThreads4W_LIBRARY} CACHE STRING "")
set(LIBPTHREADS ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(LIBPTHREADS ${PThreads4W_LIBRARY} CACHE STRING "")
set(PThreads_windows_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) set(PThreads_windows_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "")
set(PThreads_VERSION "${PThreads4W_VERSION}")
if(PThreads4W_FOUND)
set(PThreads_windows_FOUND TRUE)
endif()
#TARGETS #TARGETS
if( PThreads4W_FOUND AND NOT TARGET PThreads4W::PThreads4W_CXXEXC ) if( PThreads4W_FOUND AND NOT TARGET PThreads4W::PThreads4W_CXXEXC )