diff options
Diffstat (limited to 'ports/pthreads')
| -rw-r--r-- | ports/pthreads/CONTROL | 2 | ||||
| -rw-r--r-- | ports/pthreads/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/pthreads/usage | 9 | ||||
| -rw-r--r-- | ports/pthreads/vcpkg-cmake-wrapper.cmake | 46 |
4 files changed, 42 insertions, 25 deletions
diff --git a/ports/pthreads/CONTROL b/ports/pthreads/CONTROL index e1b96a438..43c38ffdb 100644 --- a/ports/pthreads/CONTROL +++ b/ports/pthreads/CONTROL @@ -1,4 +1,4 @@ Source: pthreads -Version: 3.0.0-1 +Version: 3.0.0-4 Homepage: https://sourceware.org/pub/pthreads-win32/ Description: pthreads for windows diff --git a/ports/pthreads/portfile.cmake b/ports/pthreads/portfile.cmake index 4debe0d26..393fefddc 100644 --- a/ports/pthreads/portfile.cmake +++ b/ports/pthreads/portfile.cmake @@ -1,14 +1,16 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + message(FATAL_ERROR "${PORT} does not currently support UWP platform nor ARM architectures") endif() -if(VCPKG_CMAKE_SYSTEM_NAME) + +if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(VCPKG_POLICY_EMPTY_PACKAGE enabled) return() endif() set(PTHREADS4W_VERSION "3.0.0") -include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE URLS "https://sourceforge.net/projects/pthreads4w/files/pthreads4w-code-v${PTHREADS4W_VERSION}.zip/download" FILENAME "pthreads4w-code-v${PTHREADS4W_VERSION}.zip" diff --git a/ports/pthreads/usage b/ports/pthreads/usage new file mode 100644 index 000000000..343c97f44 --- /dev/null +++ b/ports/pthreads/usage @@ -0,0 +1,9 @@ +The package pthreads provides CMake targets:
+
+ find_package(pthreads 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.cmake b/ports/pthreads/vcpkg-cmake-wrapper.cmake index ec5c473fb..12d390a7a 100644 --- a/ports/pthreads/vcpkg-cmake-wrapper.cmake +++ b/ports/pthreads/vcpkg-cmake-wrapper.cmake @@ -52,7 +52,7 @@ endif() set(PThreads4W_MAJOR_VERSION 3) set(PThreads4W_MINOR_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 if(NOT PThreads4W_LIBRARY) @@ -70,30 +70,36 @@ if(NOT PThreads4W_STRUCTEXC_LIBRARY) find_library(PThreads4W_STRUCTEXC_LIBRARY_DEBUG NAMES pthreadVSE${PThreads4W_MAJOR_VERSION}d) select_library_configurations(PThreads4W_STRUCTEXC) endif() -if(WIN32) - string( REPLACE ".lib" ".dll" PThreads4W_LIBRARY_RELEASE_DLL "${PThreads4W_LIBRARY_RELEASE}" ) - string( REPLACE ".lib" ".dll" PThreads4W_LIBRARY_DEBUG_DLL "${PThreads4W_LIBRARY_DEBUG}" ) - string( REPLACE ".lib" ".dll" PThreads4W_CXXEXC_LIBRARY_RELEASE_DLL "${PThreads4W_CXXEXC_LIBRARY_RELEASE}" ) - string( REPLACE ".lib" ".dll" PThreads4W_CXXEXC_LIBRARY_DEBUG_DLL "${PThreads4W_CXXEXC_LIBRARY_DEBUG}" ) - string( REPLACE ".lib" ".dll" PThreads4W_STRUCTEXC_LIBRARY_RELEASE_DLL "${PThreads4W_STRUCTEXC_LIBRARY_RELEASE}" ) - string( REPLACE ".lib" ".dll" PThreads4W_STRUCTEXC_LIBRARY_DEBUG_DLL "${PThreads4W_STRUCTEXC_LIBRARY_DEBUG}" ) -endif() find_package_handle_standard_args(PThreads4W DEFAULT_MSG PThreads4W_LIBRARY PThreads4W_CXXEXC_LIBRARY PThreads4W_STRUCTEXC_LIBRARY PThreads4W_INCLUDE_DIR) mark_as_advanced(PThreads4W_INCLUDE_DIR PThreads4W_LIBRARY PThreads4W_CXXEXC_LIBRARY PThreads4W_STRUCTEXC_LIBRARY) -#Compatibility definitions, deprecated -set(PTHREAD_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) -set(PTHREADS_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) -set(PThreads_windows_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR} CACHE PATH "" FORCE) -set(PTHREAD_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(PTHREADS_LIBRARIES ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(PTHREAD_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(PTHREADS_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(LIBPTHREAD ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(LIBPTHREADS ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) -set(PThreads_windows_LIBRARY ${PThreads4W_LIBRARY} CACHE STRING "" FORCE) +set(PThreads4W_DLL_DIR ${PThreads4W_INCLUDE_DIR}) +list(TRANSFORM PThreads4W_DLL_DIR APPEND "/../bin") +message(STATUS "PThreads4W_DLL_DIR: ${PThreads4W_DLL_DIR}") + +find_file(PThreads4W_LIBRARY_RELEASE_DLL NAMES pthreadVC${PThreads4W_MAJOR_VERSION}.dll PATHS ${PThreads4W_DLL_DIR}) +find_file(PThreads4W_LIBRARY_DEBUG_DLL NAMES pthreadVC${PThreads4W_MAJOR_VERSION}d.dll PATHS ${PThreads4W_DLL_DIR}) +find_file(PThreads4W_CXXEXC_LIBRARY_RELEASE_DLL NAMES pthreadVCE${PThreads4W_MAJOR_VERSION}.dll PATHS ${PThreads4W_DLL_DIR}) +find_file(PThreads4W_CXXEXC_LIBRARY_DEBUG_DLL NAMES pthreadVCE${PThreads4W_MAJOR_VERSION}d.dll PATHS ${PThreads4W_DLL_DIR}) +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_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 ) |
