INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE(Threads)

IF (TARGET Threads::Threads)
  SET(FOUND_THREADS TRUE)
ELSE()
  SET(FOUND_THREADS FALSE)
ENDIF()

FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLTHREADS DEFAULT_MSG FOUND_THREADS)
#Only create the TPL if we succeed
IF (FOUND_THREADS)
  KOKKOS_CREATE_IMPORTED_TPL(THREADS INTERFACE LINK_OPTIONS
          ${CMAKE_THREAD_LIBS_INIT})
ENDIF()
