32 lines
1.1 KiB
CMake
32 lines
1.1 KiB
CMake
if (NOT PTHREADS4W_ROOT)
|
|
message(FATAL_ERROR "PTHREADS4W_ROOT is required by PThreads4WConfig.cmake")
|
|
endif ()
|
|
|
|
set(_pthreads4w_prefix "${PTHREADS4W_ROOT}")
|
|
if (EXISTS "${PTHREADS4W_ROOT}/x86_64/${CMAKE_BUILD_TYPE}/include/pthread.h")
|
|
set(_pthreads4w_prefix "${PTHREADS4W_ROOT}/x86_64/${CMAKE_BUILD_TYPE}")
|
|
endif ()
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set(_pthreads4w_library "${_pthreads4w_prefix}/lib/pthreadVC3d.lib")
|
|
else ()
|
|
set(_pthreads4w_library "${_pthreads4w_prefix}/lib/pthreadVC3.lib")
|
|
endif ()
|
|
|
|
if (NOT EXISTS "${_pthreads4w_prefix}/include/pthread.h" OR NOT EXISTS "${_pthreads4w_library}")
|
|
message(FATAL_ERROR "PThreads4W installation is incomplete at ${PTHREADS4W_ROOT}")
|
|
endif ()
|
|
|
|
if (NOT TARGET PThreads4W::PThreads4W)
|
|
add_library(PThreads4W::PThreads4W UNKNOWN IMPORTED)
|
|
set_target_properties(PThreads4W::PThreads4W PROPERTIES
|
|
IMPORTED_LOCATION "${_pthreads4w_library}"
|
|
INTERFACE_INCLUDE_DIRECTORIES "${_pthreads4w_prefix}/include"
|
|
)
|
|
endif ()
|
|
|
|
set(PThreads4W_FOUND TRUE)
|
|
set(PThreads4W_RUNTIME_DIR "${_pthreads4w_prefix}/bin")
|
|
unset(_pthreads4w_library)
|
|
unset(_pthreads4w_prefix)
|