Files
Renderive/render_3D/cmake/module/FindPThreads4W.cmake
T
2026-08-13 16:48:35 +08:00

25 lines
900 B
CMake

include_guard(GLOBAL)
rcl_get_effective_install_dir(render_3D::pthreads4w PTHREADS4W_ROOT)
set(PThreads4W_INCLUDE_DIR "${PTHREADS4W_ROOT}/include")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PThreads4W_LIBRARY "${PTHREADS4W_ROOT}/lib/pthreadVC3d.lib")
else ()
set(PThreads4W_LIBRARY "${PTHREADS4W_ROOT}/lib/pthreadVC3.lib")
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PThreads4W
REQUIRED_VARS
PThreads4W_INCLUDE_DIR
PThreads4W_LIBRARY
)
if (PThreads4W_FOUND AND NOT TARGET PThreads4W::PThreads4W)
add_library(PThreads4W::PThreads4W UNKNOWN IMPORTED)
set_target_properties(PThreads4W::PThreads4W PROPERTIES
IMPORTED_LOCATION "${PThreads4W_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PThreads4W_INCLUDE_DIR}"
)
endif ()
mark_as_advanced(
PThreads4W_INCLUDE_DIR
PThreads4W_LIBRARY
)