45 lines
1.5 KiB
CMake
45 lines
1.5 KiB
CMake
include_guard(GLOBAL)
|
|
rcl_get_effective_install_dir(render_3D::PThreads4W PTHREADS4W_ROOT)
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|amd64|x86_64)$")
|
|
set(PThreads4W_ARCH "x86_64")
|
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|arm64|aarch64)$")
|
|
set(PThreads4W_ARCH "ARM64")
|
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|i[3-6]86)$")
|
|
set(PThreads4W_ARCH "x86")
|
|
else ()
|
|
set(PThreads4W_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
|
|
endif ()
|
|
set(PThreads4W_INSTALL_DIR "${PTHREADS4W_ROOT}/${PThreads4W_ARCH}/${CMAKE_BUILD_TYPE}")
|
|
find_path(PThreads4W_INCLUDE_DIR
|
|
NAMES pthread.h
|
|
PATHS "${PThreads4W_INSTALL_DIR}/include"
|
|
NO_DEFAULT_PATH
|
|
)
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set(PThreads4W_LIBRARY_NAME pthreadVC3d)
|
|
else ()
|
|
set(PThreads4W_LIBRARY_NAME pthreadVC3)
|
|
endif ()
|
|
find_library(PThreads4W_LIBRARY
|
|
NAMES "${PThreads4W_LIBRARY_NAME}"
|
|
PATHS "${PThreads4W_INSTALL_DIR}/lib"
|
|
NO_DEFAULT_PATH
|
|
)
|
|
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
|
|
)
|